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
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
Post Reply 


Messages In This Thread
NPCS - Town stones - Soulless - 07-11-2012, 07:32 AM
RE: NPCS - Town stones - Skul - 07-11-2012 08:09 AM
RE: NPCS - Town stones - Anarch Cassius - 07-11-2012, 08:17 AM
RE: NPCS - Town stones - Skul - 07-11-2012, 08:44 AM
RE: NPCS - Town stones - RanXerox - 07-11-2012, 08:56 AM
RE: NPCS - Town stones - Skul - 07-11-2012, 09:11 AM
RE: NPCS - Town stones - RanXerox - 07-11-2012, 09:24 AM
RE: NPCS - Town stones - Extreme - 07-11-2012, 09:33 AM
RE: NPCS - Town stones - Soulless - 07-11-2012, 03:35 PM
RE: NPCS - Town stones - Soulless - 07-12-2012, 10:37 AM
RE: NPCS - Town stones - Extreme - 07-12-2012, 10:45 AM
RE: NPCS - Town stones - Anarch Cassius - 07-12-2012, 11:55 AM
RE: NPCS - Town stones - Soulless - 07-12-2012, 12:14 PM
RE: NPCS - Town stones - Anarch Cassius - 07-12-2012, 01:02 PM
RE: NPCS - Town stones - Soulless - 07-12-2012, 06:15 PM
RE: NPCS - Town stones - darksun84 - 07-12-2012, 07:57 PM
RE: NPCS - Town stones - Soulless - 07-12-2012, 08:33 PM
RE: NPCS - Town stones - Soulless - 07-13-2012, 02:15 AM
RE: NPCS - Town stones - Anarch Cassius - 07-13-2012, 02:14 PM
RE: NPCS - Town stones - Soulless - 07-13-2012, 02:21 PM
RE: NPCS - Town stones - Anarch Cassius - 07-13-2012, 02:24 PM
RE: NPCS - Town stones - Soulless - 07-13-2012, 03:08 PM
RE: NPCS - Town stones - Anarch Cassius - 07-13-2012, 03:28 PM
RE: NPCS - Town stones - RanXerox - 07-13-2012, 03:29 PM
RE: NPCS - Town stones - Anarch Cassius - 07-19-2012, 01:11 PM
RE: NPCS - Town stones - Soulless - 07-26-2012, 12:33 AM

Forum Jump:


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