Hi there.
I think myself pretty good with LUA, and I'd wish to help you.
If you have any problems with LUA scripts, post them here.
No, I'm not gonna make scripts for you.
-Echoes
Hi there.
I think myself pretty good with LUA, and I'd wish to help you.
If you have any problems with LUA scripts, post them here.
No, I'm not gonna make scripts for you.
-Echoes
can u make.... no jsut kidding
can u link a good place to learn how to
do lua scripts like the commands for wow?
http://www.mmowned.com/forums/emulat...bossfight.html
wiki.ascentemu.com/index.php?title=Lua
You can also learn really much by just looking at scripts made by other people. LUA is pretty logical
Couple questions for you:
1.) I am using Phase's on my scripts and they are working, but during the phase if you only want it to happen once throughout the entire phase I am confused how to go about that. If you could clarify or point me in the right direction would be great.
2.) On the spawncreature function I am currently setting the duration extremely high
but is there a variable you can put in the duration to make it stay out till killed? The way I have it works but would rather do it correctly..
Thanks for the wiki link came in really helpful....
i just need a boss Spell lua script when its gone to 20%or less hp to cast only 1 TIME lay of hands
Name of the boss is Manket and enrty id is 2
@ McMage :
1. Let me see.. Unit:RemoveEvents should work
Example :
Here it registers unit event when boss engages in combat, says Oh noes, and registers event ExampleBoss_example, which casts examplespell every 10 seconds. It also registers ExampleBoss_example2 every 1 second, which checks if boss' health is below 70%, if it is, casts examplespell2 and Removes ExampleBoss_example event.Code:function ExambleBoss_example(pUnit, Event) pUnit:FullCastSpell(exampleid) end function ExampleBoss_example1(pUnit, Event) pUnit:SendChatMessage(12, 0, "Oh noes") pUnit:RegisterEvent("ExampleBoss_example", 10000, 0) pUnit:RegisterEvent("ExampleBoss_example2", 1000, 0) end function ExampleBoss_example2(pUnit, Event) if pUnit:GetHealthPct() < 70 then pUnit:FullCastSpell(exampleid2) pUnit:RemoveEvents(); end end RegisterUnitEvent(ExampleBossID, 1, "ExampleBoss_example1")
2. I think there's no way to do it so. The way you are doing should work.
@ Zenneth
I said that I wont do scripts, but because im bored, im gonna do it for you
Copy this into notepad and save as Manket.lua or something
Code:function Manket_Phase1(pUnit, Event) if pUnit:GetHealthPct() < 20 then pUnit:FullCastSpell(27154) end end RegisterUnitEvent(2, 1, "Manket_Phase1")
I got a script here for the warpNPC maker.
Code:
How do I add it to a NPC?Code:#include "StdAfx.h" #include "Setup.h" #ifdef WIN32 #pragma warning(disable:4305)// warning C4305: 'argument' : truncation from 'double' to 'float' #endif class SCRIPT_DECL WarpNPC : public GossipScript { public: void Destroy() { delete this; } void GossipHello(Object* pObject, Player * Plr, bool AutoSend) { GossipMenu *Menu; objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr); Menu->AddItem(5,"The Mall", 1); Menu->AddItem(5,"The Mall", 2); if(AutoSend) Menu->SendTo(Plr); } void GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code) { Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL; if(pCreature==NULL) return ; GossipMenu *Menu; switch(IntId) { case 1: //The Mall { //Check if the player is the right level. if(Plr->getLevel() < 1) { //Teleport the player. Plr->EventTeleport( 530, -1862.016479, 5432.329102, -9.705356); }else{ pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Sorry, you need to be level 1 To do that."); } Plr->Gossip_Complete(); }break; case 2: //The Mall { //Check if the player is the right level. if(Plr->getLevel() < 1) { //Teleport the player. Plr->EventTeleport( 530, -1862.016479, 5432.329102, -9.705356); }else{ pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Sorry, you need to be level 1 To do that."); } Plr->Gossip_Complete(); }break; } } };
Nice little service here mate, it will help loads considering people never stop asking about how do I do this, how do I do that, LUA is quite easy when you get to know it..
Threads of the Week: [Errage] [Blizzard] [Rapidshare]
Romis, I only do LUA things. You should ask Gastricpenguin, he knows more about C++.
Thank you for your time, I really do appreciate it..... Will try that when I get home!!
Oh was that C++? xD
Sorry
Heh, np :P (For both of you)
Sorry to bother you but have yet another question, could you show me how to do a randomspell. IE (ExampleMob casts 1 of 4 spells every 20seconds) Trying to add the unknown factor. Well semi unknown...
I seen your other post about doing scripts /bow
Thank you yet again, I really did search on how to do this prior to asking you again
Mc Mage I would do it make this:
Id Being 6600002 But im sure there is a easyer way...Code:function Boss_Bolt (pUnit, Event) pUnit:CastSpell (Spell ID Here) function Boss_Bolt (pUnit, event) if pUnit:GetHealthPct() < 99 then pUnit:RemoveEvents() pUnit:RegisterEvent("Boss_Bolt",20000, 0) end end function Boss_OnCombat(pUnit, event) pUnit:RegisterEvent("Boss_Bolt",10000, 0) end RegisterpUnitEvent(6600002, 1, "Boss_OnCombat")
Cheese Cake?
ok so here is my thing hwo to you make a player say somthing see i am amking an add on i just cant get the player to say somthing when i push the button this is needed for gm addon