SphereCommunity
Unequip gloves, arms, and help when use archery. - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Requests (/Forum-Script-Requests)
+--- Thread: Unequip gloves, arms, and help when use archery. (/Thread-Unequip-gloves-arms-and-help-when-use-archery)



Unequip gloves, arms, and help when use archery. - Lazarus - 08-27-2012 06:03 PM

Anyone can create me something like this?

When you equip a bow or crossbow, unequips instantly the gloves, arms and any helm [PLATEMAIL]

And, when I equip a helm or arms or gloves PLATEMAIL TYPE, checks the bow and unequip it.

If I need add a TEVENTS= in EVERY armor, no problem ^_^ I'll do it.


Thanks!

Sry for the english.
I wish that you can understand me Tongue


RE: Unequip gloves, arms, and help when use archery. - Shaklaban - 08-27-2012 08:44 PM

PHP Code:
[typedef t_weapon_bow]
on=@equip
src
.unequip_helm_gloves

[typedef t_weapon_xbow]
on=@equip
src
.unequip_helm_gloves


[function unequip_helm_gloves]
for 
6 7
if (<findlayer.<local._for>>)
   if (<
findlayer.<local._for>.isavaiblewitharchery> = 0)
        
findlayer.<local._for>.cont=<findlayer.layer_pack>
   endif
endif
endfor
  

[
typedef t_armor]
on=@equiptest
if ((<findlayer.layer_hand2.type> = t_weapon_bow) || (<findlayer.layer_hand2.type> = t_weapon_xbow))
    if (<
isavaiblewitharchery> = 0)
        return 
1
    
endif
endif
 

[function 
isavaiblewitharchery]
if <
type> != t_armor
    
return 1
else
     
local.dispidsi=<serv.itemdef.<baseid>.dispid//aganist flipping
     
if (<serv.itemdef.<local.dispidsi>.tag0.noarchery> = 1//with that line you don't need to add tag.noarchery to gold, blackrock etc. items
         
return 0
    
endif
endif
return 
1


//example item def.

[ITEMDEF 01412]
DEFNAME=i_platemail_helm
TYPE
=T_ARMOR
FLIP
=1
RESOURCES
=15 i_ingot_iron
WEIGHT
=10
ARMOR
=40
REQSTR
=60
CATEGORY
=Provisions Armor
SUBSECTION
=Platemail Armor
DESCRIPTION
=Platemail Helm
DUPELIST
=01419
SKILLMAKE
=BLACKSMITHING 62.6
TAG
.NOARCHERY=//NO ARCHERY

ON=@Create
COLOR
=color_o_iron
HITPOINTS
={50 60



RE: Unequip gloves, arms, and help when use archery. - Extreme - 08-28-2012 02:35 AM

PHP Code:
[EVENTS E_ARCHERY_SYSTEM]
ON=@ITEMEQUIP
IF STRMATCH(*BOW*,<ACT.TYPE>)
 
FINDLAYER.6.UNEQUIP
 FINDLAYER.7
.UNEQUIP
 FINDLAYER.19
.UNEQUIP
ENDIF 
Add this event to all players.


RE: Unequip gloves, arms, and help when use archery. - Lazarus - 08-28-2012 02:53 AM

(08-27-2012 08:44 PM)Shaklaban Wrote:  
PHP Code:
[typedef t_weapon_bow]
on=@equip
src
.unequip_helm_gloves

[typedef t_weapon_xbow]
on=@equip
src
.unequip_helm_gloves


[function unequip_helm_gloves]
for 
6 7
if (<findlayer.<local._for>>)
   if (<
findlayer.<local._for>.isavaiblewitharchery> = 0)
        
findlayer.<local._for>.cont=<findlayer.layer_pack>
   endif
endif
endfor
  

[
typedef t_armor]
on=@equiptest
if ((<findlayer.layer_hand2.type> = t_weapon_bow) || (<findlayer.layer_hand2.type> = t_weapon_xbow))
    if (<
isavaiblewitharchery> = 0)
        return 
1
    
endif
endif
 

[function 
isavaiblewitharchery]
if <
type> != t_armor
    
return 1
else
     
local.dispidsi=<serv.itemdef.<baseid>.dispid//aganist flipping
     
if (<serv.itemdef.<local.dispidsi>.tag0.noarchery> = 1//with that line you don't need to add tag.noarchery to gold, blackrock etc. items
         
return 0
    
endif
endif
return 
1


//example item def.

[ITEMDEF 01412]
DEFNAME=i_platemail_helm
TYPE
=T_ARMOR
FLIP
=1
RESOURCES
=15 i_ingot_iron
WEIGHT
=10
ARMOR
=40
REQSTR
=60
CATEGORY
=Provisions Armor
SUBSECTION
=Platemail Armor
DESCRIPTION
=Platemail Helm
DUPELIST
=01419
SKILLMAKE
=BLACKSMITHING 62.6
TAG
.NOARCHERY=//NO ARCHERY

ON=@Create
COLOR
=color_o_iron
HITPOINTS
={50 60

Code:
13:51:ERROR:(sphere_types.scp,396)Can't resolve <findlayer.layer_hand2.type>
13:51:ERROR:(sphere_types.scp,396)Can't resolve <findlayer.layer_hand2.type>
13:51:ERROR:(sphere_types.scp,396)Undefined symbol ''
13:51:ERROR:(sphere_types.scp,396)Undefined symbol ''

Happend this when i try with arms, gloves and helm.

Only works with the helm Sad
and, when I equip bow, the helm works, unequips, but, i can equip it again and then have: bow and helm.


Lazarus.

Thanks :!


RE: Unequip gloves, arms, and help when use archery. - darksun84 - 08-31-2012 11:58 PM

Try with @EquiptTest