SphereCommunity
typedef question - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: typedef question (/Thread-typedef-question)

Pages: 1 2


typedef question - daedelus - 08-31-2012 01:07 PM

Need to know how I can add a [typedef t_plate] only with gloves and arms platemail (in general, any mineral).

The script is to uneqeuip all the arms and gloves when you equip a bow or xbow, but I need it to be just the type platemail.

Code:
[TYPEDEF T_PLATE]

[TYPEDEF T_SACARBRAZOSYGLOVES]

ON=@EQUIP
IF ( <SRC.FINDLAYER.LAYER_GLOVES>  || <SRC.FINDLAYER.LAYER_ARMS>) && ((<SRC.FINDLAYER.LAYER_HAND2.TYPE> == T_WEAPON_BOW) || (<SRC.FINDLAYER.LAYER_HAND2.TYPE> == T_WEAPON_XBOW))
  SRC.FINDLAYER.LAYER_GLOVES.UNEQUIP
   SRC.FINDLAYER.LAYER_ARMS.UNEQUIP
    SRC.SYSMESSAGE @70 Si usas un arco no puedes usar guantes y brazos platemail!
   RETURN 1
  ELSE
ENDIF

I think something (<SRC.FINDLAYER.LAYER_GLOVES.TYPE> == T_PLATE) .

Thanks


RE: typedef question - Skul - 08-31-2012 02:34 PM

I was pretty sure this was answered yesterday. Yep, this was already requested a few days ago here: http://forum.spherecommunity.net/showthread.php?tid=1711


RE: typedef question - daedelus - 08-31-2012 09:44 PM

Yes i saw, but i'm trying to make myself... The scripts works, but i like to unequip only plate parts.

Thanks


RE: typedef question - Extreme - 09-01-2012 02:29 AM

@equip
For 1 24
If strmatch(*t_plate*,<src.findlayer.<dlocal._for>>)
Src.findlayer.<dlocal._for>.unequip
Endif
Endfor


RE: typedef question - daedelus - 09-01-2012 03:42 AM

(09-01-2012 02:29 AM)Extreme Wrote:  @equip
For 1 24
If strmatch(*t_plate*,<src.findlayer.<dlocal._for>>)
Src.findlayer.<dlocal._for>.unequip
Endif
Endfor

Can you explain me For 1 24?.

I think this :

Code:
[FUNCTION F_SACAR_ARMS_GLOVES]

ON=@EQUIP
IF ((<SRC.FINDLAYER(7).BASEID>==i_<ARGV[0]>_platemail_Gauntlets) || (<UID.<ARGV[1]>.BASEID>==i_<ARGV[0]>_platemail_Gauntlets) || (<SRC.FINDLAYER(19).BASEID>==i_<ARGV[0]>_platemail_arms) || (<UID.<ARGV[1]>.BASEID>==i_<ARGV[0]>_platemail_arms)) && ((<SRC.FINDLAYER.LAYER_HAND2.TYPE> == T_WEAPON_BOW) || (<SRC.FINDLAYER.LAYER_HAND2.TYPE> == T_WEAPON_XBOW))
SRC.FINDLAYER.LAYER_HAND2.TYPE == T_WEAPON_BOW.EQUIP || SRC.FINDLAYER.LAYER_HAND2.TYPE == T_WEAPON_XBOW.EQUIP
  SRC.FINDLAYER.LAYER_GLOVES.UNEQUIP
   SRC.FINDLAYER.LAYER_ARMS.UNEQUIP
    SRC.SYSMESSAGE @70 Si usas un arco no puedes usar guantes y brazos platemail!
   RETURN 1
  ELSE
ENDIF

[FUNCTION F_ARCO]

ON=@EQUIP
IF ((<SRC.FINDLAYER.LAYER_HAND2.TYPE> == T_WEAPON_BOW) || (<SRC.FINDLAYER.LAYER_HAND2.TYPE> == T_WEAPON_XBOW)) && ((<SRC.FINDLAYER(7).BASEID>==i_<ARGV[0]>_platemail_Gauntlets) || (<UID.<ARGV[1]>.BASEID>==i_<ARGV[0]>_platemail_Gauntlets) || (<SRC.FINDLAYER(19).BASEID>==i_<ARGV[0]>_platemail_arms) || (<UID.<ARGV[1]>.BASEID>==i_<ARGV[0]>_platemail_arms))
  SRC.FINDLAYER.LAYER_GLOVES.UNEQUIP
   SRC.FINDLAYER.LAYER_ARMS.UNEQUIP
    SRC.SYSMESSAGE @70 Si usas un arco no puedes usar guantes y brazos platemail!
   RETURN 1
  ELSE
ENDIF
ENDIF

Thanks


RE: typedef question - Extreme - 09-01-2012 05:48 AM

PHP Code:
ON=@ITEMEQUIPTEST
IF STRMATCH(*T_BOW*,<ACT.TYPE>)
 IF 
STRMATCH(*T_PLATE*,<SRC.FINDLAYER.LAYER_GLOVES.TYPE>)
  
SRC.FINDLAYER.LAYER_GLOVES.UNEQUIP
 
ENDIF
 IF 
STRMATCH(*T_PLATE*,<SRC.FINDLAYER.LAYER_ARMS.TYPE>)
  
SRC.FINDLAYER.LAYER_ARMS.UNEQUIP
 
ENDIF
ENDIF
IF 
STRMATCH(*T_PLATE*,<ACT.TYPE>) && ((<ACT.LAYER> == LAYER_ARMS) || (<ACT.LAYER> == LAYER_GLOVES))
 IF 
STRMATCH(*T_BOW*,<SRC.FINDLAYER.2.TYPE>)
  
SRC.FINDLAYER.2.UNEQUIP
 
ENDIF
ENDIF 



RE: typedef question - daedelus - 09-01-2012 07:46 AM

you can explain me this script? Smile

Thanks


RE: typedef question - Extreme - 09-01-2012 08:55 AM

No. Read it and understand your self.


RE: typedef question - Mordaunt - 09-01-2012 11:53 AM

It's not hard...

When you equip this, check for that and if present unequip


RE: typedef question - daedelus - 09-03-2012 09:52 PM

Ok, i understand this, but this For 1 24? 1 24 ?.

Thanks