Thread Rating:
- 0 Votes - 0 Average
- 1
- 2
- 3
- 4
- 5
Crusader
Master
Posts: 254
Likes Given: 7
Likes Received: 19 in 12 posts
Joined: Apr 2012
Reputation: 6
Erehwon New Hera
|
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 |
|
|
Messages In This Thread |
Varskill - Crusader - 02-28-2013 05:24 AM
|
User(s) browsing this thread: 2 Guest(s)