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
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Varskill
Author Message
Crusader
Master
**

Posts: 254
Likes Given: 7
Likes Received: 19 in 12 posts
Joined: Apr 2012
Reputation: 6

Erehwon New Hera

Post: #1
Varskill
Varskill <skillnumber> <value>
is a function to take control over the skills we add to an item or a char.
Code + 2 test items below.
Any suggestions for bugfix, exploit, improving will be really appreciated

Code:
[FUNCTION VARSKILL]
IF !(0<ISCHAR>)
        RETURN 0
ENDIF
OBJ=<UID>
IF (<OBJ.FINDID.i_mem_varskill>)
        REF1=<FINDID.i_mem_varskill>
        IF !(0<REF1.TAG.<eval <ARGN1>>>) // nuova skill, la aggiungo
                REF1.TRIGGER @Unequip
                REF1.TAG0.<eval <ARGN1>> = <EVAL <ARGN2>>
                REF1.TRIGGER @Equip
        ELSE    // trovo la stessa skill e ne sommo i valori
                REF1.TRIGGER @Unequip
                REF1.TAG0.<eval <ARGN1>> = <EVAL <REF1.TAG0.<eval <ARGN1>>> + <ARGN2>>
                REF1.TRIGGER @Equip
                IF (<EVAL <REF1.TAG0.<eval <ARGN1>>>> == 0) // se la somma รจ zero, cioe' sto togliendo probabilmente l'item che visto che aggiungo una skill negativa
                        REF1.MORE1 -= 1
                        REF1.TIMER=5
                ENDIF
        ENDIF
ELSE // nn trovo la memory, equippo per la prima volta
        NEWITEM i_mem_varskill
        NEW.TAG.<eval <ARGN1>> = <eval <ARGN2>>
        NEW.CONT=<UID>
        NEW.TRIGGER @Equip
ENDIF
RETURN 1


[ITEMDEF i_mem_varskill]
ID=i_memory
TYPE=t_eq_script
NAME=Skill

CATEGORY=Erehwon
SUBSECTION=NON TOCCARE
DESCRIPTION=Change Skill

ON=@Create
ATTR=attr_decay

ON=@Equip
local.tagcount = <tagcount> -1
IF <dLOCAL.tagcount> >= 0
FOR 0 <local.tagcount>
        LOCAL.SKILLFOUND=<eval <TAGAT.<LOCAL._FOR>.KEY>>
        LOCAL.SKILLVALUE=<eval <TAGAT.<LOCAL._FOR>.VALUE>>
        TRY CONT.<dLOCAL.SKILLFOUND> = <EVAL <CONT.<dLOCAL.SKILLFOUND>>> + <dLOCAL.SKILLVALUE>
        MORE1 += 1
ENDFOR
ENDIF
RETURN 0

ON=@Unequip
local.tagcount = <tagcount> - 1
IF (<dLOCAL.tagcount> > 0)
        FOR 0 <local.tagcount>
                LOCAL.SKILLFOUND=<eval <TAGAT.<LOCAL._FOR>.KEY>>
                LOCAL.SKILLVALUE=<eval <TAGAT.<LOCAL._FOR>.VALUE>>
                TRY CONT.<dLOCAL.SKILLFOUND> = <EVAL <CONT.<dLOCAL.SKILLFOUND>>> - <dLOCAL.SKILLVALUE>
                MORE1 -= 1
        ENDFOR
ELIF (<dLOCAL.tagcount> == 0)
                LOCAL.SKILLFOUND=<eval <TAGAT.0.KEY>>
                LOCAL.SKILLVALUE=<eval <TAGAT.0.VALUE>>
                TRY CONT.<dLOCAL.SKILLFOUND> = <EVAL <CONT.<dLOCAL.SKILLFOUND>>> - <dLOCAL.SKILLVALUE>
                MORE1 -= 1
ENDIF
RETURN 0

ON=@TIMER
IF (<EVAL <MORE1>> <=0)
REMOVE
ENDIF
RETURN 1

[ITEMDEF i_mazzetta]
ID = i_mace
TYPE = t_weapon_mace_smith
NAME = mazza

ON=@EQUIP
SRC.VARSKILL 30 50
SRC.VARSKILL 31 10
RETURN 0

ON=@UNEQUIP
SRC.VARSKILL 30 -50
SRC.VARSKILL 31 -10
RETURN 0

[ITEMDEF i_armat]
ID = i_platemail_chest
TYPE = t_armor
NAME = armatura

ON=@EQUIP
SRC.VARSKILL 30 50
SRC.VARSKILL 35 10
RETURN 0

ON=@UNEQUIP
SRC.VARSKILL 30 -50
SRC.VARSKILL 35 -10
RETURN 0
02-28-2013 05:24 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
Varskill - Crusader - 02-28-2013 05:24 AM
RE: Varskill - RanXerox - 02-28-2013, 10:01 AM
RE: Varskill - Crusader - 02-28-2013, 06:14 PM
RE: Varskill - RanXerox - 03-01-2013, 01:44 AM

Forum Jump:


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