[help] how i make "Revive Guard"

10/05/2008 07:01 reborn666#1
I had an idea to put a guard at the jail, to revive the players who are dead or someone you know might help?:)
10/05/2008 10:36 _Emme_#2
Easy,im not going to post the actual code for you,just some parts that are needed.

Name-checker
If the player is in the same map
Checks if the character is dead
MobUseCharSkill, the revive skill on an character
Sleep for around 5 seconds
Do it again


Easy.
10/05/2008 15:16 tao4229#3
Quote:
Originally Posted by emildayan1 View Post
Easy,im not going to post the actual code for you,just some parts that are needed.

Name-checker
If the player is in the same map
Checks if the character is dead
MobUseCharSkill, the revive skill on an character
Sleep for around 5 seconds
Do it again


Easy.
Yeah, you have to watch out, the mob's make sure their target is dead, you have to reverse it for revivers.
+ After MobAttacksCharSkill you'll need to ACTUALLY revive the person as
the skill is just the effect.

Target.Revive(false)

Couldn't have said it better emme, I wonder why :rolleyes:
10/05/2008 15:35 _Emme_#4
I didnt get a shit of what ur talking about tao,as I said a week ago,stop the drugs kid! Nah,im kidding,but yeah you have to revive the target and shit,but as I said I wont post the actual code.
+Thanks to you for letting me look at reviving guards a few weeks ago,just to get the idea of what to do. At the moment,im using my own style,which works better to me.
10/05/2008 18:00 tao4229#5
Quote:
Originally Posted by emildayan1 View Post
I didnt get a shit of what ur talking about tao,as I said a week ago,stop the drugs kid! Nah,im kidding,but yeah you have to revive the target and shit,but as I said I wont post the actual code.
+Thanks to you for letting me look at reviving guards a few weeks ago,just to get the idea of what to do. At the moment,im using my own style,which works better to me.
Nice, I haven't done anything to them in forever <3

I haven't coded anything that's worth doing except funny stuff for myself in a while actually... >_>
10/06/2008 00:25 reborn666#6
ty emme
Quote:
else if (MType == 2)
World.MobAttacksCharSkill(this, Target, (uint)DMG, 1100, 0);
this work!
no more revives the dead, the guard uses in players who are alive, and revive any time, any idea?
10/06/2008 20:54 xxFastBoy#7
Quote:
Originally Posted by reborn666 View Post
ty emme
this work!
no more revives the dead, the guard uses in players who are alive, and revive any time, any idea?
in Client.cs ??????
10/06/2008 22:30 tao4229#8
Quote:
Originally Posted by bela144 View Post
in Client.cs ??????
No, stop being a dumbass.
10/06/2008 22:33 _Emme_#9
Something like this,that defines that it should sleep a bit,and only revive players in the map and bla bla bla,.

Quote:
Character Charr = (Character)DE.Value;
if (DateTime.Now > Charr.Death.AddSeconds(5))
if (Charr.LocMap == this.Map)
{
if (!Charr.Alive)
{
Charr.Revive(false);
System.Threading.Thread.Sleep(100);
World.MobAttacksCharSkill(this, Charr, 0, 1100, 0);
}
}
Dont forget to do a foreach allchars above all that shit,then also make sure the source checks if its the name of the mob is Reviver
10/06/2008 22:38 xxFastBoy#10
Quote:
Originally Posted by tao4229 View Post
No, stop being a dumbass.
what is problem?? shit'
10/06/2008 22:41 tao4229#11
Quote:
Originally Posted by bela144 View Post
what is proble?? shit'
KOS OMAK.




Okay other than unneeded spam... emme pretty much GAVE you the code, with a few changes that works, but it's not the best way to approach it. Not like I did any better :p. Anyways, the only major thing that prevents THAT from working is... you have to make sure on GetTarget() (in Entities.cs with all the other mob crap) if the name is reviver or the type is whatever, you allow them to target only DEAD people, instead of alive.
10/06/2008 22:42 xxFastBoy#12
Quote:
Originally Posted by emildayan1 View Post
Something like this,that defines that it should sleep a bit,and only revive players in the map and bla bla bla,.


Dont forget to do a foreach allchars above all that shit,then also make sure the source checks if its the name of the mob is Reviver


can u tell we add to where???
10/07/2008 02:27 reborn666#13
Quote:
Originally Posted by emildayan1 View Post
Something like this,that defines that it should sleep a bit,and only revive players in the map and bla bla bla,.


Dont forget to do a foreach allchars above all that shit,then also make sure the source checks if its the name of the mob is Reviver

reliving players still alive and not the dead ..! look

Quote:
if (MType == 2)
World.MobAttacksCharSkill(this, Target, 0, 1100, 0);
{
foreach (DictionaryEntry DE in World.AllChars)
{
Character Charr = (Character)DE.Value;
if (DateTime.Now > Charr.Death.AddSeconds(5))
if (Charr.LocMap == this.Map)
{
if (!Charr.Alive)
{
Charr.Revive(true);
System.Threading.Thread.Sleep(100);
}
}
}
}
Thanks for helping me be :handsdown: