The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Race selection script
Author Message
Shidhun
Journeyman
*

Posts: 59
Likes Given: 5
Likes Received: 3 in 3 posts
Joined: Jul 2012
Reputation: 1



Post: #4
RE: Race selection script
On my Server, we define Races/Classes by using Tags :

Tag.Plot1=0100 <-- this could be the Human Race
Tag.Plot1=0200 <-- this could be the Elven Race
...

Tag.Plot2=0100 <-- this could be a warrior class
Tag.Plot2=0200 <-- this could be a mages class
...

and so on.

Now how do we give the correct Tags to the players? Plain and simply by using "moongates" which attach them @step

Example :

Code:
[TYPEDEF t_human_plot]
ON=@STEP
    IF (<SRC.ISGM>)||(<ARGN1>)
        RETURN 1
    ENDIF
    IF !(<SRC.TAG0.PLOT1>)
        IF (<SRC.FLAGS>&02)
            SRC.SYSMESSAGE Ghosts can't choose a race!
        ELSE
            SRC.SYSMESSAGE You are now a human
            SRC.TAG.PLOT1=0100
            // SRC.EVENTS=e_human <-- only if needed, on our shard we apply bonus-damage defined by the race (for example humans could make a damage-bonus on sword-weapons, elves on fencing-weapons etc
            SRC.TITLE=Human
            SRC.f_get_start_items //this function just deletes every item the character has, and gives him race-specific items
            SRC.GO=<MOREP>
            SRC.SOUND=snd_SPELL_BLESS
        ENDIF
    ELSE
        SRC.SYSMESSAGE You allready belong to another race
    ENDIF
    RETURN 0

Within other scripts you could check for the plot simply by using a type of this function :

Code:
[FUNCTION ishuman]
IF (<TAG0.PLOT1>&0100)
    RETURN 1
ELSE
    RETURN 0
ENDIF

For Race-Checking you could then just use :

Code:
if <src.ishuman>
src.sysmessage you are a human yeahh!
else
src.sysmessage you are no human
endif
09-15-2013 10:15 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Race selection script - maos32 - 09-15-2013, 06:37 PM
RE: Race selection script - dagger4k - 09-15-2013, 07:52 PM
RE: Race selection script - maos32 - 09-15-2013, 09:24 PM
RE: Race selection script - Shidhun - 09-15-2013 10:15 PM
RE: Race selection script - maos32 - 09-15-2013, 10:56 PM
RE: Race selection script - XuN - 09-15-2013, 11:17 PM
RE: Race selection script - Rattlehead - 09-16-2013, 08:29 AM
RE: Race selection script - maos32 - 09-16-2013, 08:10 PM
RE: Race selection script - Shidhun - 09-16-2013, 09:59 PM
RE: Race selection script - maos32 - 09-17-2013, 07:35 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)