The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NPCS - Town stones
Author Message
Soulless
Super Moderator
****

Posts: 335
Likes Given: 29
Likes Received: 49 in 27 posts
Joined: Jun 2012
Reputation: 12

Ye Olde Sphere

Post: #1
NPCS - Town stones
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


Attached File(s)
.scp  faction_dialogs-config.scp (Size: 16.27 KB / Downloads: 28)
.scp  faction_events.scp (Size: 1.25 KB / Downloads: 24)
.scp  faction_items.scp (Size: 4.58 KB / Downloads: 25)
.scp  faction_npcs.scp (Size: 5.73 KB / Downloads: 25)
(This post was last modified: 07-26-2012 12:17 AM by Soulless.)
07-11-2012 07:32 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #2
RE: NPCS - Town stones
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.

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
07-11-2012 08:09 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Anarch Cassius
Master
**

Posts: 273
Likes Given: 19
Likes Received: 10 in 9 posts
Joined: Mar 2012
Reputation: 2



Post: #3
RE: NPCS - Town stones
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
07-11-2012 08:17 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #4
RE: NPCS - Town stones
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] ???

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
(This post was last modified: 07-11-2012 08:45 AM by Skul.)
07-11-2012 08:44 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #5
RE: NPCS - Town stones
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.)
07-11-2012 08:56 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #6
RE: NPCS - Town stones
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!

"I ask a question to the answer I already know."

Marchadium :: http://www.marchadium.ca/ :: Join us!
07-11-2012 09:11 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #7
RE: NPCS - Town stones
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...)
07-11-2012 09:24 AM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #8
RE: NPCS - Town stones
OMG! These tags are awesome.
God bless ShiriuX hahahaha

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
07-11-2012 09:33 AM
Find all posts by this user Like Post Quote this message in a reply
Soulless
Super Moderator
****

Posts: 335
Likes Given: 29
Likes Received: 49 in 27 posts
Joined: Jun 2012
Reputation: 12

Ye Olde Sphere

Post: #9
RE: NPCS - Town stones
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
07-11-2012 03:35 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Soulless
Super Moderator
****

Posts: 335
Likes Given: 29
Likes Received: 49 in 27 posts
Joined: Jun 2012
Reputation: 12

Ye Olde Sphere

Post: #10
RE: NPCS - Town stones
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.
07-12-2012 10:37 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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