Question: Echo when someone dies

Mponthepc

Big Gnobody
Joined
Mar 16, 2006
Messages
96
Reaction score
1
Points
0
Anyone know of a quick loop that will echo back a person's name as soon as they die in the zone.
 
Hmmm when someone die ? When a player die ? a Mob ?

When he/it die near you, you can get it out the chat windows

like:
#Event Someonedie "#*#dies#*#" dont know the correct "die" statement :)

when you want to check a "special" mob, target him/it and you see the sate of the mob
or target and get the id of the mob and you can recheck him/it

more information could be helpfull :)
 
problem with that way is they must be in range when they die to get message.
 
hmmm you can target a "named"
/target Blubb

then you get the ID
/varset MobbelID ${Target.ID}

than get PctHPs
/varset MobbelHP ${MobbelID.PctHPs}

now you can sen it to /bc - /tell or /echo it like
/echo ${MobbelID.Name} has now ${MobbelHP}% HP ...

or something like this, when you want you can put it in a loop

give us more information and we find a way :)

--- back to topic

or you can do something like

/if (${MobbelHP}<=0 ) /echo ${MobbelID.Name} is death ...
there are to mutch ways to write down :)
 
if you just want to know when anyone at all in the entire zone dies then something like this would do it:

Code:
Sub main
	/declare alreadyFound				string local
	/declare cNum								int local
	/declare cID								int local 0
	/declare lastcID						int local 0
	:mainLoop
		/varset cNum 0
		:nextCorpse
		/varset lastcID ${cID}
		/varcalc cNum ${cNum} + 1
		/varset cID ${Me.NearestSpawn[Corpse]}
		/if (${cID} && ${cID}!=${lastCID}) {
			/if (!${alreadyFound.Find[${cID}]} && ${Spawn[${cID}].Deity.ID}) {
				/echo ${Spawn[${cID}].DisplayName} has died.
				/varset alreadyFound ${alreadyFound}|${cID}
                                /goto :nextCorpse
			} else {
				/goto :nextCorpse
			}
		}
	/goto :mainLoop
/return

No thats not the cleanest way to do it but it would work. Also you have the potential problem there that if someone dies, retrieves their corpse and then someone else gets the same ID that they had and then dies, it would not see their corpse.

But the chances of that happening, unless you are running this for days straight, is pretty slim.

Now as others have said if you be more specific in what your wanting to do, can probably give you a better solution to do it with.
 
just use the plugin that announces when someone leaves the zone. Or maybe see if you can do a spawncount HOVER since it shows them in zone when they are in hovermode with RIP next to his/her name.
 
Use MQ2Targets. If you want it to do this in all zones, ensure you have the option turned on under [Settings] for UseAllZone=1. This was what I added in some time in the fuzzy past, to allow additional alerts in all zones.

For the alert you could do like:

[all]
spawn0=pc corpse|notify

Or modify to your needs.

htw