SphereCommunity
NPCs acting like their are in a guild... - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: NPCs acting like their are in a guild... (/Thread-NPCs-acting-like-their-are-in-a-guild)

Pages: 1 2


NPCs acting like their are in a guild... - x77x - 01-05-2015 02:25 PM

since we cant have npcs in a guild, im trying to figure out a way to make it look like they are in your guild...


Code:
[EVENTS e_army_wei]
ON=@NPCSEENEWPLAYER
IF (<src.tag.army>=WEI)
TAG.NAME.HUE 03f
Say Hail Friend!
RETURN 0
ELSEIF (<src.tag.army>=WU) || (<src.tag.army>=SHU) || (<src.tag.army>=YS) || (<src.tag.army>=LB) || (<src.tag.army>=YT) || (<src.tag.army>=MH)
TAG.NAME.HUE 090
Say Attack the soldier of <src.tag.army>!
ATTACK
RETURN 0
ELSEIF (<src.iscriminal>=1) || (<src.kills>>3)
Say Beat it criminal!
ATTACK
RETURN 0
ENDIF


i cant get this to work...

is there a better way?
problem with this is, if the npcs sees a different player, the first player then sees the wrong color...


RE: NPCs acting like their are in a guild... - evening - 01-05-2015 03:55 PM

[EVENTS e_army_wei]
ON=@click
IF (<src.tag.army>=WEI)
MESSAGE @03F <NAME>
Say Hail Friend!
ELSEIF (<src.tag.army>=WU) || (<src.tag.army>=SHU) || (<src.tag.army>=YS) || (<src.tag.army>=LB) || (<src.tag.army>=YT) || (<src.tag.army>=MH)
MESSAGE @090 <NAME>
Say Attack the soldier of <src.tag.army>!
ATTACK
ELSEIF (<src.iscriminal>=1) || (<src.kills>>3)
Say Beat it criminal!
ATTACK
ENDIF
RETURN 1


RE: NPCs acting like their are in a guild... - XuN - 01-05-2015 05:33 PM

ELSEIF (<src.tag.army>=WU) || (<src.tag.army>=SHU) || (<src.tag.army>=YS) || (<src.tag.army>=LB) || (<src.tag.army>=YT) || (<src.tag.army>=MH)

One = means SET; ie STR=100, double == means comparison; ie if ( <str> == 100 ).

Anyway you can't compare strings, you have to use something like this: ELSEIF ( STRCMP("<src.tag.army>","WU")==0) || ...


RE: NPCs acting like their are in a guild... - x77x - 01-06-2015 02:58 AM

11:58:ERROR:(SPHERE_ARMY_WEI.scp,20)Undefined symbol 'WU'
11:58:ERROR:(SPHERE_ARMY_WEI.scp,20)Undefined symbol 'WEI'


hmmmm


RE: NPCs acting like their are in a guild... - x77x - 01-06-2015 03:13 PM

seems like im having trouble with a text tag... if i use numbers it works

Code:
[EVENTS e_army_wei]
ON=@NPCSEENEWPLAYER
//ON=@click
IF (<src.tag.army>=04000)
TAG.NAME.HUE 03f
Say Hail Friend!
RETURN 0
ELSEIF (<src.tag.army>=04001) || (<src.tag.army>=04002) || (<src.tag.army>=04003) || (<src.tag.army>=04004) || (<src.tag.army>=04005) || (<src.tag.army>=04006)
TAG.NAME.HUE 090
Say Attack the soldier of <SRC.MEMORYFINDTYPE.0400.NAME>!
ATTACK
RETURN 0
ELSEIF (<src.kills>>3) //(<src.iscriminal>=1) ||
Say Beat it criminal!
ATTACK
RETURN 0
ELSEIF (<SRC.MEMORYFINDTYPE.0400.LINK>>040004010)//every players guild
Say Attack the soldier of <SRC.MEMORYFINDTYPE.0400.NAME>!
ATTACK
RETURN 0
ENDIF
RETURN 1



RE: NPCs acting like their are in a guild... - darksun84 - 01-06-2015 08:06 PM

Anyway, as they told, you must use == for comparing


RE: NPCs acting like their are in a guild... - Extreme - 01-07-2015 07:09 AM

lol..


RE: NPCs acting like their are in a guild... - x77x - 01-24-2015 11:51 AM

getting closer....

Code:
[EVENTS e_army_wei]
//ON=@NPCSEENEWPLAYER
ON=@click
IF (STRCMPI("<src.tag.army>","Wei")==0)
TAG.NAME.HUE 03f
Say Hail Friend!
RETURN 0
ELSE
IF (STRCMPI("<src.tag.army>","Wu")==0)  || (STRCMPI("<src.tag.army>","Shu")==0)  || (STRCMPI("<src.tag.army>","YS")==0)  || (STRCMPI("<src.tag.army>","LB")==0)  || (STRCMPI("<src.tag.army>","YT")==0)  || (STRCMPI("<src.tag.army>","MH")==0)  
TAG.NAME.HUE 090
Say Attack the soldier of <SRC.TAG.ARMY>!
ATTACK
RETURN 0
ELSE
IF (<src.kills>>3) || (<src.criminal>==1)//(<flags>&statf_criminal)LINE15
Say Beat it criminal!
ATTACK
RETURN 0
ELSE
IF (<SRC.MEMORYFINDTYPE.0400.LINK>>040004010)//every players guild
Say Attack the soldier of <SRC.MEMORYFINDTYPE.0400.NAME>!
ATTACK
RETURN 0
ELSE
IF (<src.tag.army>==0)//LINE25
RETURN 0
ENDIF
RETURN 1


20:47:ERROR:(SPHERE_ARMY_WEI.scp,15)Can't resolve <src.criminal>
20:47:ERROR:(SPHERE_ARMY_WEI.scp,15)Undefined symbol ''
20:47:ERROR:(SPHERE_ARMY_WEI.scp,25)Undefined symbol ''


whats wrong with line 15 and 25?


RE: NPCs acting like their are in a guild... - XuN - 01-25-2015 01:26 AM

ON=@click
serv.log SRC is <src.name> (<src.uid>)// place this line under @Click to see who is the SRC in the function, Items can't be criminals and I bet this is the problem (It is weird, I know...).

and line 25 ... <src.tag.army> returns '' (no value) if the tag doesn't exists, use <src.tag0.army> instead for tags that can not be present on the checking character/item/etc.


RE: NPCs acting like their are in a guild... - x77x - 01-25-2015 07:04 AM

found this in another script... seems to work

Code:
IF (<SRC.TARG.FLAGS>&statf_criminal) || (<SRC.TARG.KILLS> >= 3 ) || (<SRC.TARG.KARMA> <= -2000 )
Say Beat it criminal!
ATTACK
RETURN 0