Hello guys, Here is a guide showing you how to make your or an NPC speak at the percent of it's health. Ex: At 50% of it's health it will say something like "Argh..Your making me upset!"
Alright, here is a template.
Look and use the template below
Code:
Code:
global Npc_Name_Health = function(mob)
{
if(.GetHealthPct() <= %_of_HP && Npc_Name == 0)
{
.SendChatMessage("What you want your Npc to say");
global Npc_Name = 1;
}
if(.GetHealthPct() <= %_of_HP && Npc_Name == 1)
{
.CastSpell(5200);
.SendChatMessage("What you want your Npc to say");
global Npc_Name = 2;
}
if(.GetHealthPct() <= %_of_HP && Npc_Name == 2)
{
.SendChatMessage("What you want your Npc to say");
global Npc_Name = 3;
}
};
global VanCleef_Combat = function(plr)
{
global VC_PHASE = 0;
.RegisterTimer(Time in Miller Seconds, Npc_Name_Health, 0);
.SendChatMessage("What you want your Npc to say");
};
.RegisterUnitEvent(Npc ID, 1, Npc_Name_Combat);Step 1 : All the things in red is the things you need to put in your self. (Can't seem to make it red hehe)
Step 2 : Open up NotePad or WordPad and copy and paste that template into it and then start modifying it with steps below.
Step 3 : global Npc_Name_Health = function(mob) = This is the name of your or the NPC that will speak.
Step 4 : if(.GetHealthPct() <= %_of_HP && Npc_Name == 0) = The % of where the NPC will say the message you chose at the % of Hp (Ex, 70 = 70%, 50 = 50%, Etc..)
Step 5 : if(.GetHealthPct() <= %_of_HP && Npc_Name == 0) = The same as in "Step 3" The name of your NPC (Must be the same as Step 3 and the rest of the Naming ones.)
Step 6 : .SendChatMessage("What you want your NPC to say"); = The message you want your NPC to say when it gets to the % of the Hp.
Step 7 : global Npc_Name = 1; = The Name of your NPC (Remember, must be the same as every one where it says NPC_Name)
Step 8 : .RegisterUnitEvent(Npc ID, 1, Npc_Name_Combat); = The NPC Entry Spawn ID of your Npc (Ex, .npc spawn 123456, Etc)
Step 9 : .RegisterUnitEvent(Npc ID, 1, Npc_Name_Combat); = The Name of your NPC in all the other place you put it (Make sure it is the same as all the other places)
Code:
Code:
}
if(.GetHealthPct() <= %_of_HP && Npc_Name == 2)
{
.SendChatMessage("What you want your Npc to say");
global Npc_Name = 3;
}Also, you can keep adding more to make the NPC talk more.
-->And now naming it<--
Naming - It's hard, but then again, it's easy. Now when your done modifying it, go to File > Save as > and select "All Files" and call it like, (If you are doing it for a NPC called Cyberous, I would call it Cyberous.gm). So like in "Step 3" The Name of your NPC, just name it that and put a .gm at the end of it so it ends up being Cyberous.gm
Saving It : Save it to your Desktop or some were you will remember where it is.
Step 10 : The place you will put this folder is in the scripts folder. So the location should be this:
C:\AC Web Ultimate Repack\Ascent\scripts
After that you can just restart your server.
And that's about it, Enjoy!.