Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CanUse extension
Author Message
golfin
Banned

Posts: 213
Likes Given: 2
Likes Received: 32 in 28 posts
Joined: Nov 2017

Eranova

Post: #6
RE: CanUse extension
For about 10 days, I've tried different ways to write this CanUse flag. It was not without success, but it was not what I wanted. So I resolved it differently. I use the ON=@EquipTest trigger directly on the subject. Can I keep the CanUse flag for the race. To enter a job, I placed the code directly to the subject using the function. See the following example. But you need to delete everything around CanUse in sphere_item_typedef_equipitem.scp and put it to the subject. TEVENTS=t_equipitem must be commented.

Code:
[ITEMDEF i_helm_swiftness]
ID=i_helm_winged
NAME=Helm of Swiftness
CanUse=can_u_elf
BonusInt=5
FasterCasting=1
FasterCastRecovery=2
RESPHYSICAL=6
RESFIRE=5
RESCOLD=6
RESPOISON=6
RESENERGY=8
MageArmor=1
//TEVENTS=t_equipitem
CATEGORY=Artifacts
SUBSECTION=Minor Artifacts
DESCRIPTION=Helm of Swiftness
ON=@Create
   COLOR=0592
   ATTR=attr_magic|attr_identified
   HITPOINTS=255

ON=@EquipTest
    IF ( ( (<CanUse>&can_u_elf) && !(<SRC.f_iself>) ) && !( (<CanUse>&can_u_human) && (<src.f_IsHuman>) ) )        
        IF <SRC.IsUndeclared>
            SRC.SYSMESSAGELOC color_text,1070722,<def.can_use_warrior>
            RETURN 1
        ELSEIF <SRC.IsRanger>
            SRC.SYSMESSAGELOC color_text,1070722,<def.can_use_warrior>
            RETURN 1
        ELSEIF <SRC.IsSorcerer>
            SRC.SYSMESSAGELOC color_text,1070722,<def.can_use_warrior>
            RETURN 1
        ELSEIF <SRC.IsAlchemyst>
            SRC.SYSMESSAGELOC color_text,1070722,<def.can_use_warrior>
            RETURN 1
        ELSEIF <SRC.IsThiev>
            SRC.SYSMESSAGELOC color_text,1070722,<def.can_use_warrior>
            RETURN 1
        ENDIF
    ENDIF
    
ON=@ClientToolTip
IF (<canuse> &can_u_elf) && !((<canuse>&can_u_human) || (<canuse>&can_u_gargoyle))
    SRC.ADDCLILOC 1075086
ENDIF
    src.addcliloc=1070722,<def.only_warrior>

This works smoothly as I wanted to * Smile *
Even though, I will have multiple rows in scripts.

Well, I thought, I will try to create [TYPEDEF t_equipitem] for all jobs separately. [TYPEDEF t_equipitem_warrior], [TYPEDEF t_equipitem_ranger] and so on ... It will come out * smile *


Yes and it works well as a separate typedef, heurekaa
(This post was last modified: 10-25-2018 05:06 AM by golfin.)
10-25-2018 04:35 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
CanUse extension - golfin - 10-23-2018, 03:01 AM
RE: CanUse extension - darksun84 - 10-23-2018, 06:12 PM
RE: CanUse extension - golfin - 10-23-2018, 06:55 PM
RE: CanUse extension - darksun84 - 10-23-2018, 08:30 PM
RE: CanUse extension - golfin - 10-23-2018, 09:14 PM
RE: CanUse extension - golfin - 10-25-2018 04:35 AM

Forum Jump:


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