no...
i want him to be stealth when it start
and when he reach less than 50% of hes/her hp to cast stun thats all lol
no...
i want him to be stealth when it start
and when he reach less than 50% of hes/her hp to cast stun thats all lol
K.. ill se what i can dooo
Cheese Cake?
kk all done try this one.
Save as LUA :
Code:function Boss_Phase1(pUnit, event) if pUnit:GetHealthPct() < 50 then pUnit:RemoveEvents() pUnit:GetClosestPlayer(1) pUnit:CastSpell(22427) pUnit:SendChatMessage(12, 0, "You Gonna Die %N") end end function Boss_OnCombat(pUnit, event) pUnit:CastSpell(10032) pUnit:RegisterEvent("Boss_Phase1",1000, 0) end RegisterpUnitEvent(104, 1, "Boss_OnCombat")
Cheese Cake?
its not a correct lua...
here is what it say RogueRogue.lua (could not run)
scripts\RogueRogue .lua :17:attempt to call global 'RegisterpUnit event' <a nil value>
snailz ur lua script is not correct..... .... ...not working
i manage to fix that somehow but still got another big prob.....
function Boss_Phase1111(pUnit, event)
if pUnit:GetHealthPct() < 50 then
pUnit:RemoveEvents()
pUnit:GetClosestPlayer(1)
pUnit:CastSpell(22427)
pUnit:SendChatMessage(12, 0, "You Gonna Die $N")
end
end
function Rogue_start1(pUnit, Event)
pUnit:RegisterEvent("Boss_Phase1111",1000, 0)
pUnit:FullCastSpell(10032)
end
RegisterUnitEvent(104, 6, "Rogue_start1")
This time the boss target only him self! i mean he cast the spell to himself/herself lol....
can someone help me fix it so it can target player ?
Yeah sorry about that
Is RightCode:function Boss_Phase1(pUnit, event) if pUnit:GetHealthPct() < 50 then pUnit:RemoveEvents() pUnit:GetClosestPlayer(1) pUnit:CastSpell(22427) pUnit:SendChatMessage(12, 0, "You Gonna Die %N") end end function Boss_OnCombat(pUnit, event) pUnit:CastSpell(10032) pUnit:RegisterEvent("Boss_Phase1",1000, 0) end Register pUnitEvent(104, 1, "Boss_OnCombat")
or
RegisterpUnit Event
Cheese Cake?
Also Try
pUnit:GetMainTank()
Cheese Cake?
ammm same thing happen like last time....
ur sql is incorect or smething and cant give me the same error......
Lua is not my thing but, heres a C++ script for it
- save this as A_name_you_like.cpp
- and put it in your instance scripts folder
- open your scripts solution
- drag the file into the instance scripts, in the solution explorer (the pane on the left of the window) in the scripts folder.
- add the lines into your setup.cpp and setup.h files
- compile your scripts and voila!
Code:#include "StdAfx.h" #include "Setup.h" //--------------------------Custom Creature-----------------------------// //------------------------Scripted by Pepsi1x1--------------------------// #define CN_KING 104 #define UBER_STEALH 10032 #define STUN 22427 class KingAI : public CreatureAIScript { public: ADD_CREATURE_FACTORY_FUNCTION(KingAI); KingAI(Creature* pCreature) : CreatureAIScript(pCreature) { spells[0].info = dbcSpell.LookupEntry(UBER_STEALH); spells[0].targettype = TARGET_SELF; spells[0].instant = true; spells[1].info = dbcSpell.LookupEntry(STUN); spells[1].targettype = TARGET_RANDOM_SINGLE; spells[1].instant = true; spells[1].speech = "You Gonna Die"; } void OnSpawn() { _unit->CastSpell(_unit, spells[0].info, spells[0].instant); break; } void OnCombatStart(Unit* mTarget) { RegisterAIUpdateEvent(1500); } void OnTargetDied(Unit* mTarget) { } void OnCombatStop(Unit *mTarget) { _unit->GetAIInterface()->setCurrentAgent(AGENT_NULL); _unit->GetAIInterface()->SetAIState(STATE_IDLE); RemoveAIUpdateEvent(); } void OnDied(Unit * mKiller) { _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "Im...dead!"); RemoveAIUpdateEvent(); } void AIUpdate() { if(_unit->GetHealthPct() < 50) { target = _unit->GetAIInterface()->GetNextTarget(); _unit->CastSpell(target, spells[i].info, spells[i].instant); break; if (spells[i].speech != "") { _unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, spells[i].speech.c_str()); _unit->PlaySoundToSet(spells[i].soundid); } RemoveAIUpdateEvent(); } } }; void SetupCustomCreature(ScriptMgr * mgr) { mgr->register_creature_script(CN_KING, &KingAI::Create); }
add this line in to your setup.cpp
and this line into your setup.hCode:SetupCustomCreature(mgr);
then compileCode:void SetupCustomCreature(ScriptMgr * mgr);
Last edited by pepsi1x1; 03-01-2008 at 02:56 AM.
well man great thx for u guide but i am still learning lua...
I am not that Exceprt or smart or intellect like u to do the guide
Anyway big thx! And once i am done with that i will try ur code C++!
+rep pepsi and again thx