What controls.
- Who and what can see players when they are dead.
- How to apply that to an NPC.
I am wanting to create ghost that can only be seen if you are dead or have spirit speak and that will attack players and drain their mana. I was going to rip the idea off the file that control player dead and just modify the hit script. What control the above mentioned to players?
Ghosties
Not easily done if it can be done. Who/what can see players when dead? 'Seeghosts' privilege. Really, this is only useful on player chars like staff members.
NPCs can see ghosts with SYSEVENT_ENTEREDAREA or SYSEVENT_GHOST_SPEECH and ListGhostsNearLocation() or ListMobilesNearLocationEx() with the LISTEX_GHOSTS flag.
NPCs can see ghosts with SYSEVENT_ENTEREDAREA or SYSEVENT_GHOST_SPEECH and ListGhostsNearLocation() or ListMobilesNearLocationEx() with the LISTEX_GHOSTS flag.
The only way I can see doing this is actually screwing with cmdlevels. Conceal the mobile to 1 and then anyone with high enough spirit speak can be upped to cmdlevel = 1. Of course, you'd have to bump staff cmdlevels up 1 and search through all checks of cmdlevel in your scripts. Although I don't think you'd be able to hide it to someone that is dead without packethooks but this may cause some undesirable effects.
I love that idea. Heres what I will do. CWO you amaze me.
1. All players 0 unless 90% ss or dead then they are bumped to one. It will be a check, if they are under 90% and they are alive they will be 0. If they are dead or have 90% spirit speak they will be set to cmdlevel := 1. That is actually a nice way of doing this. Is there a good place to put this so it does not generate an enormous amount of lag?
1. All players 0 unless 90% ss or dead then they are bumped to one. It will be a check, if they are under 90% and they are alive they will be 0. If they are dead or have 90% spirit speak they will be set to cmdlevel := 1. That is actually a nice way of doing this. Is there a good place to put this so it does not generate an enormous amount of lag?
I would put it on death, login, and resurrection. It shouldn't lag really since its only a few instructions...
Watch your counselor cmdlevel though as I said before. You'll probably want to bump it up one by defining a new cmdlevel in cmds.cfg and make sure you change all scripts that reference cmdlevel. And also since you defined a new cmdlevel, you can even make textcmds and such available only to those of that level.
Code: Select all
if (!who.cmdlevel)
if (GetAttribute(who, "spiritspeak") >= 90)
who.cmdlevel := 1;
endif
endif
Where is the Res function stored? When I get this done would you like me to post it in the Custom Scripts topic? Is Resurrect() a core function and ResNow() the actual check?
This is what I am doing at those checks. Its a bit redundant but it should work.
I prefer to If statements, it helps me keep it in some sort of order.
This is what I am doing at those checks. Its a bit redundant but it should work.
Code: Select all
//start spirit check
var ss := GetObjProperty(who, "spiritspeak");
if(who.cmdlevel == 0)
if(ss >= 90)
who.cmdlevel := 1;
endif
endif
if(who.cmdlevel == 1)
if(ss <=89.9)
who.cmdlevel := 0;
endif
endif
Resurrect(who, flags := 0) is a core function. Look for instances of Resurrect in your scripts. Also, to clean up your code a little...
Remember to GetAttribute not GetObjProperty... a skill level isn't a custom prop.
Code: Select all
if (GetAttribute(who, "spiritspeak") >= 90)
who.cmdlevel := 1;
else
who.cmdlevel := 0;
endif