SphereCommunity
NPCS - Town stones - Printable Version

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

Pages: 1 2 3


NPCS - Town stones - Soulless - 07-11-2012 07:32 AM

I've updated this script. decided to include the whole thing, and an outline of the system

please let me know if there is any issues

Features:
  • 4 races per faction
  • faction guards to guard each towns sigil
  • Silver rewarded for killing enemy factions, defending sigils, and corrupting sigils
  • faction dyes useable by faction members
  • 15 minutes to capture a sigil
  • after a sigil is captured it is locked for 30 minutes to prevent two people trading back and forth for silver
  • after a sigil has been defended its locked for 7 minutes to prevent trading sigils for silver as well
  • system messages colored in orange in green for easy visability
  • sigil pillar usable after sigil has been captured
  • titles avaialble for purchase with silver
  • faction status veiwable at sigil pillar
  • can summon up to five guards from each faction pillar



RE: NPCS - Town stones - Skul - 07-11-2012 08:09 AM

yes, sendpacket can help you do this. considering npcs don't over-ride their notoriety by sphere's default behavior. Uhm, let me post a script I made, it was not designed to do exactly what you want, but the idea is in the code, maybe you can use it to manifest your own idea?

Check it out:
Code:
[FUNCTION updatecharacter]
IF (<ISCHAR>)
    IF !( <FLAGS> & statf_dead )
        LOCAL.UID=<UID>
        IF ( <FLAGS> & statf_hidden ) || ( <FLAGS> & statf_invisible ) || ( <FLAGS> & statf_insubstantial )
            LOCAL.STATS=<LOCAL.STATS> | 080
        ENDIF
        IF ( <FLAGS> & statf_war )
            LOCAL.STATS=<LOCAL.STATS> | 040
        ENDIF
        IF ( <FLAGS> & statf_freeze )
            LOCAL.STATS=<LOCAL.STATS> | 08
        ENDIF
        IF ( <FLAGS> & statf_poisoned )
            LOCAL.STATS=<LOCAL.STATS> | 04
        ENDIF
        FORCLIENTS 18
            IF (<ACCOUNT.RESDISP> >= 4)
                SENDPACKET 077 D<LOCAL.UID> W<UID.<LOCAL.UID>.DISPID> W<UID.<LOCAL.UID>.P.X> W<UID.<LOCAL.UID>.P.Y> <UID.<LOCAL.UID>.Z> <UID.<LOCAL.UID>.DIR> W<UID.<LOCAL.UID>.COLOR> <HVAL <LOCAL.STATS>> <HVAL <UID.<LOCAL.UID>.NOTOGETFLAG <UID>>>
            ENDIF
        ENDFOR
    ENDIF
ENDIF

So packet 077 is 'that' packet you need to change the highlight color of your guards, this function should be called off your guard by let's say @click (when the guard becomes near) or based on a timer from the guard npc itself (some people can disable @click by client settings). This will send packet 077 to all clients in the area to update the character 'updatecharacter' function is called upon. I didn't put any checks in to see if the npc is at war or in another faction, i simply have this looking for the standard stat flags.

The last packet in SENDPACKET
Code:
<HVAL <UID.<LOCAL.UID>.NOTOGETFLAG <UID>>>
represents the highlight color using NOTOGETFLAG, you can probably change this to suit your own faction/town/race/guild system you have by coding a function to return the desired highlight war/ally color.

I hope it helps (and makes any sense at all!) lol.


RE: NPCS - Town stones - Anarch Cassius - 07-11-2012 08:17 AM

Don't forget this

09-10-2010, ShiryuX
- Added: "TAG.OVERRIDE.NOTO" and "TAG.OVERRIDE.NOTO.$uid" as notoriety flag overrides.
TAG.OVERRIDE.NOTO is a general override for the notoriety flag.
TAG.OVERRIDE.NOTO.$uid overrides the noto flag according to the viewer $uid.
* NOTE: The general override is applied before the viewer tag. So it will override EVERYTHING.
Usable flags can be found on sphere_defs.scp


RE: NPCS - Town stones - Skul - 07-11-2012 08:44 AM

Oh ya, I haven't been online recently to try that out. I remember chatting about it, does it override completely? I remember using the code I posted above and having to call it in the walk packet (packet0x02), it was a super lag because sphere's default behavior would override the noto on every step. Although I did notice that NPCs did retain their NOTO color using sendpacket, so I thought of posting this.

I'll have to try that new feature out, hopefully it works better than I could get it. Been trying to get guild wars going properly, also custom noto for team PvP events. Thanks Anarch, much appreciated!
Quick question, CTAG.OVERRIDE.NOTO[.$uid] ???


RE: NPCS - Town stones - RanXerox - 07-11-2012 08:56 AM

I presume if you set the $uid version after the global one you can un-override (or make special exceptions) for specific people (like your guildmates or party members etc.)


RE: NPCS - Town stones - Skul - 07-11-2012 09:11 AM

exactly Ran, then I'll have lingering tags (considering a player can delete his own character), CTAG would come in use, can always store the tags with 1 as well haha, but ya, just wondering!


RE: NPCS - Town stones - RanXerox - 07-11-2012 09:24 AM

I imagine the intended use for these overrides is for guilds, parties, and team sports... so that your guild buddies, party members, and team mates are always a particular color even if they accidentally hit you (or steal from your corpse, etc...)


RE: NPCS - Town stones - Extreme - 07-11-2012 09:33 AM

OMG! These tags are awesome.
God bless ShiriuX hahahaha


RE: NPCS - Town stones - Soulless - 07-11-2012 03:35 PM

Oh thats super guys. thank you all for your help. This has resolved my issue and now everything is going quite swimmingly Smile

THANK YOU


RE: NPCS - Town stones - Soulless - 07-12-2012 10:37 AM

Just want to say thanks again guys, this worked out perfect and my custom faction system is in place perfectly. love the faction guards. just watching the chaos from taking control of a town is fun. the guards spawn, start attacking the old guards, just making new guards is a hoot, spearmen, horsemen, macers, archers, and mages and such.