SphereCommunity
Name colors and colors for pets, npc, monsters - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Name colors and colors for pets, npc, monsters (/Thread-Name-colors-and-colors-for-pets-npc-monsters)



Name colors and colors for pets, npc, monsters - Extreme - 07-10-2012 11:33 AM

I want to make a script like OSI when if you are in a guild, and have a pet, your pet become green for your and for your guildmates.
If you are blue (without guild) your pet is blue for you and for all others players...
If you are red, your pet is red for everyone...

I want to make them with the same notoriety of the owner, but I don't know how to do :/
I really don't know about memoryfindtypes.

Thanks


RE: Name colors and colors for pets, npc, monsters - Skul - 07-10-2012 11:46 AM

the criminal system, it's alot of work and working around to get that going right. I did it on my server, had to alter alot of original coding, redo the whole criminal system completely (turned it off in sphere.ini). Considering helpingacriminalisacrime had to be turned off and calling guards had to be completely rescripted. Tons of work, I'd paste my code but it's jumbled up in dozens of various scripts.


RE: Name colors and colors for pets, npc, monsters - Anarch Cassius - 07-10-2012 11:49 AM

In Sphere.ini

// Which notoriety flags do pets inherit from their masters? (default 0)
// Set flags to indicate which notoriety statuses a pet can inherit from its owner.
// NotoGood = 0x01 // blue
// NotoGuildSame = 0x02 // green (ally)
// NotoNeutral = 0x04 // grey (can be attacked)
// NotoCriminal = 0x08 // grey (criminal)
// NotoGuildWar = 0x10 // orange (enemy guild)
// NotoEvil = 0x20 // red
// e.g. "03a" will show pets as criminal/warring/evil/allied when their master has
// one of these statuses, regardless of the pet's true notoriety.
PetsInheritNotoriety=0


RE: Name colors and colors for pets, npc, monsters - Extreme - 07-10-2012 12:27 PM

Ok, tried with this:
PetsInheritNotoriety=01|02|04|08|010|020
Code:
ON=@Click
IF (<TAG0.NAME.HUE>)
LOCAL.COLOR=<TAG0.NAME.HUE>
ELIF ((((<REGION.FLAGS>&region_flag_guarded) || (<REGION.FLAGS>&region_flag_safe)) && ((<BODY>==c_man) || (<BODY>==c_woman) || (<ISVENDOR>))) || (<FLAGS>&statf_invul))
LOCAL.COLOR=04ac
//ELIF ((<NOTOGETFLAG <SRC>,0> == 4) || (<NOTOGETFLAG <SRC>,0> == 3) || (<NOTOGETFLAG <SRC>,0> == 6))  //criminal
ELIF ((<NOTOGETFLAG <SRC>,0> == 4) || (<NOTOGETFLAG <SRC>,0> == 3)) //criminal
LOCAL.COLOR=946
ELIF (<NOTOGETFLAG <SRC>,0> == 1)
LOCAL.COLOR=058
ELIF (<NOTOGETFLAG <SRC>,0> == 2)
LOCAL.COLOR=044
ELIF (<NOTOGETFLAG <SRC>,0> == 5)
LOCAL.COLOR=02b
ELIF (<NOTOGETFLAG <SRC>,0> == 6)
LOCAL.COLOR=026
ENDIF
LOCAL.REALNAME=<NAME>
IF (STRMATCH(* the*,<SERV.CHARDEF.<BASEID>.NAME>)) && !(STRMATCH(* the*,<NAME>))
LOCAL.REALNAME .= , <STRSUB <HVAL (StrIndexOf(<SERV.CHARDEF.<BASEID>.NAME>,the,0))> 99 <SERV.CHARDEF.<BASEID>.NAME>>
ENDIF
MESSAGE @<LOCAL.COLOR>,3,1 <LOCAL.REALNAME>
RETURN 1
The only thing that don't works is: the pet don't become blue if you are blue or red if you are red (for yourself)...
All the other suppositions are okay.

Edit: always the pet become gray for the owner, because memory_ispet always do it (probally its hardcoded)


RE: Name colors and colors for pets, npc, monsters - Anarch Cassius - 07-10-2012 01:42 PM

Yeah, that sounds about... I think override tags may be able to fix it but I haven't experiment.