Offical forum of LASP, a project to script all the areas in wow via LUA
HomeHome  ­FAQFAQ  ­SearchSearch  ­MemberlistMemberlist  ­UsergroupsUsergroups  ­Donate!  ­RegisterRegister  ­Log inLog in  
Post new topic   Reply to topicShare | 
 

 scripting a boss

View previous topic View next topic Go down 
AuthorMessage
sufa
Spammer?


Posts: 37
Join date: 2008-04-27

PostSubject: scripting a boss   Sat May 10, 2008 6:30 am

i need to script a custom boss and i am finding it hard can you make me the script?? if i tell you the details plssss
Back to top Go down
View user profile
Darhan
Admin
Admin


Posts: 63
Join date: 2008-04-23

PostSubject: Re: scripting a boss   Sat May 10, 2008 6:37 am

http://lasp.forummotion.com/news-and-announcements-f1/request-scripts-t32.htm

or use this:

Code:

--Basic Boss Lua Script By Yerney
--It contains the Phase chain and it is nothing special
--You need to add spell function / spells your self, and text ofc :P
--Feel free to edit and use it without credit(Only the editable scripts, not the blizzlike)
--Enjoy!



function Boss_OnCombat(pUnit, Event)
pUnit:RegisterEvent("Boss_Phase2", 1000, 0)
end

function Boss_Phase2(pUnit, Event)
if pUnit:GetHealthPct() < 90 then
pUnit:RegisterEvent("Boss_Phase3", 1000, 0)
end
end

function Boss_Phase3(pUnit, Event)
if pUnit:GetHealthPct() < 80 then
pUnit:RegisterEvent("Boss_Phase4", 1000, 0)
end
end

function Boss_Phase4(pUnit, Event)
if pUnit:GetHealthPct() < 70 then
pUnit:RegisterEvent("Boss_Phase5", 1000, 0)
end
end

function Boss_Phase5(pUnit, Event)
if pUnit:GetHealthPct() < 60 then
pUnit:RegisterEvent("Boss_Phase6", 1000, 0)
end
end

function Boss_Phase6(pUnit, Event)
if pUnit:GetHealthPct() < 50 then
pUnit:RegisterEvent("Boss_Phase7", 1000, 0)
end
end

function Boss_Phase7(pUnit, Event)
if pUnit:GetHealthPct() < 40 then
pUnit:RegisterEvent("Boss_Phase8", 1000, 0)
end
end


function Boss_Phase8(pUnit, Event)
if pUnit:GetHealthPct() < 30 then
pUnit:RegisterEvent("Boss_Phase9", 1000, 0)
end
end

function Boss_Phase9(pUnit, Event)
if pUnit:GetHealthPct() < 20 then
pUnit:RegisterEvent("Boss_Phase10", 1000, 0)
end
end

function Boss_Phase10(pUnit, Event)
if pUnit:GetHealthPct() < 10 then
pUnit:RegisterEvent("Boss_Phase11", 1000, 0)
end
end

function Boss_Phase11(pUnit, Event)
if pUnit:GetHealthPct() < 5 then
pUnit:SendChatMessage(14, 0, "Text here plx")
end
end

function Boss_LeaveCombat(pUnit, Event)
pUnit:RemoveEvents()
end

function Boss_Dead(pUnit, Event)
pUnit:RemoveEvents()
end

function Boss_KilledTarget(pUnit, Event)
pUnit:SendChatMessage(14, 0, "Owned")
end

RegisterUnitEvent(entryid, 1, "Boss_OnCombat")
RegisterUnitEvent(entryid, 2, "Boss_LeaveCombat")
RegisterUnitEvent(entryid, 3, "Boss_KilledTarget")
RegisterUnitEvent(entryid, 4, "Boss_Dead")
Back to top Go down
View user profile
sufa
Spammer?


Posts: 37
Join date: 2008-04-27

PostSubject: Re: scripting a boss   Sat May 10, 2008 6:48 am

what are the commands to make boss talk and do i need to register it somewere?
Back to top Go down
View user profile
sufa
Spammer?


Posts: 37
Join date: 2008-04-27

PostSubject: Re: scripting a boss   Sat May 10, 2008 7:02 am

ok i tryed this will it work?[code] function Boss_OnCombat(pUnit, Event)
Unit:SendChatMessage(12, 0 , "Welcome to your death!!!")
pUnit:RegisterEvent("Boss_Phase2", 1000, 0)
end

function Boss_Phase2(pUnit, Event)
if pUnit:GetHealthPct() < 90 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase3", 1000, 0)
end
end

function Boss_Phase3(pUnit, Event)
if pUnit:GetHealthPct() < 80 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase4", 1000, 0)
end
end

function Boss_Phase4(pUnit, Event)
if pUnit:GetHealthPct() < 70 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase5", 1000, 0)
end
end

function Boss_Phase5(pUnit, Event)
if pUnit:GetHealthPct() < 60 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase6", 1000, 0)
end
end

function Boss_Phase6(pUnit, Event)
if pUnit:GetHealthPct() < 50 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase7", 1000, 0)
end
end

function Boss_Phase7(pUnit, Event)
if pUnit:GetHealthPct() < 40 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase8", 1000, 0)
end
end


function Boss_Phase8(pUnit, Event)
if pUnit:GetHealthPct() < 30 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase9", 1000, 0)
end
end

function Boss_Phase9(pUnit, Event)
if pUnit:GetHealthPct() < 20 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase10", 1000, 0)
end
end

function Boss_Phase10(pUnit, Event)
if pUnit:GetHealthPct() < 10 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase11", 1000, 0)
end
end

function Boss_Phase11(pUnit, Event)
if pUnit:GetHealthPct() < 5 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:SendChatMessage(14, 0, "Text here plx")
end
end

function Boss_LeaveCombat(pUnit, Event)
Unit:SendChatMessage(12, 0 , "HOO leaving are you now chicken!!")
pUnit:RemoveEvents()
end

function Boss_Dead(pUnit, Event)
Unit:SendChatMessage(12, 0 , "Noooo i never tought you beat me!!!!")
pUnit:RemoveEvents()
end

function Boss_KilledTarget(pUnit, Event)
Unit:SendChatMessage(12, 0 , "Fool You Are Not Prepared!!")
pUnit:SendChatMessage(14, 0, "Owned")
end

RegisterUnitEvent(3, 1, "Boss_OnCombat")
RegisterUnitEvent(40009, 2, "Boss_LeaveCombat")
RegisterUnitEvent(40009, 3, "Boss_KilledTarget")
RegisterUnitEvent(40009, 4, "Boss_Dead")
Back to top Go down
View user profile
Darhan
Admin
Admin


Posts: 63
Join date: 2008-04-23

PostSubject: Re: scripting a boss   Sat May 10, 2008 7:08 am

Change the Unit:SendChatMessage to pUnit:SendChatMessage and it will work.

RegisterUnitEvent(3, 1, "Boss_OnCombat")

is the entry id 3?
Back to top Go down
View user profile
sufa
Spammer?


Posts: 37
Join date: 2008-04-27

PostSubject: Re: scripting a boss   Sat May 10, 2008 11:42 am

no it is 40009
Back to top Go down
View user profile
Cholzzon
Spammer?


Posts: 30
Join date: 2008-05-08
Age: 15
Location: Sweden

PostSubject: Re: scripting a boss   Sat May 10, 2008 12:13 pm

but you did put 3 on the

RegisterUnitEvent(3, 1, "Boss_OnCombat")
Back to top Go down
View user profile http://www.nxwow.aowc.net
sufa
Spammer?


Posts: 37
Join date: 2008-04-27

PostSubject: Re: scripting a boss   Sat May 10, 2008 1:04 pm

modified it

function Boss_OnCombat(pUnit, Event)
pUnit:SendChatMessage(12, 0 , "Welcome to your death!!!")
pUnit:RegisterEvent("Boss_Phase2", 1000, 1)
end

function Boss_Phase2(pUnit, Event)
if pUnit:GetHealthPct() < 90 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase3", 1000, 1)
end
end

function Boss_Phase3(pUnit, Event)
if pUnit:GetHealthPct() < 80 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase4", 1000, 1)
end
end

function Boss_Phase4(pUnit, Event)
if pUnit:GetHealthPct() < 70 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase5", 1000, 1)
end
end

function Boss_Phase5(pUnit, Event)
if pUnit:GetHealthPct() < 60 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase6", 1000, 1)
end
end

function Boss_Phase6(pUnit, Event)
if pUnit:GetHealthPct() < 50 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase7", 1000, 1)
end
end

function Boss_Phase7(pUnit, Event)
if pUnit:GetHealthPct() < 40 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase8", 1000, 1)
end
end


function Boss_Phase8(pUnit, Event)
if pUnit:GetHealthPct() < 30 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase9", 1000, 1)
end
end

function Boss_Phase9(pUnit, Event)
if pUnit:GetHealthPct() < 20 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase10", 1000, 1)
end
end

function Boss_Phase10(pUnit, Event)
if pUnit:GetHealthPct() < 10 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase11", 1000, 1)
end
end

function Boss_Phase11(pUnit, Event)
if pUnit:GetHealthPct() < 5 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase11", 1000, 1)
end
end

function Boss_LeaveCombat(pUnit, Event)
pUnit:SendChatMessage(12, 0 , "HOO leaving are you now chicken!!")
pUnit:RemoveEvents()
end

function Boss_Dead(pUnit, Event)
pUnit:SendChatMessage(12, 0 , "Noooo i never tought you beat me!!!!")
pUnit:RemoveEvents()
end

function Boss_KilledTarget(pUnit, Event)
pUnit:SendChatMessage(12, 0 , "Fool You Are Not Prepared!!")
pUnit:SendChatMessage(14, 0, "Owned")
end

RegisterUnitEvent(40009, 1, "Boss_OnCombat")
RegisterUnitEvent(40009, 2, "Boss_LeaveCombat")
RegisterUnitEvent(40009, 3, "Boss_KilledTarget")
RegisterUnitEvent(40009, 4, "Boss_Dead")
Back to top Go down
View user profile
sufa
Spammer?


Posts: 37
Join date: 2008-04-27

PostSubject: Re: scripting a boss   Sat May 10, 2008 1:06 pm

does it make a difference if the last number is like this pUnit:RegisterEvent("Boss_Phase11", 1000, 1<--------) because like this pUnit:RegisterEvent("Boss_Phase11", 1000, 0<-----) he was spamming the spell and now pUnit:RegisterEvent("Boss_Phase11", 1000, 1<--------) he is doing nothing >.<
Back to top Go down
View user profile
sufa
Spammer?


Posts: 37
Join date: 2008-04-27

PostSubject: Re: scripting a boss   Sat May 10, 2008 1:07 pm

and he is not talking when he does the spell
Back to top Go down
View user profile
Darhan
Admin
Admin


Posts: 63
Join date: 2008-04-23

PostSubject: Re: scripting a boss   Sun May 11, 2008 2:29 pm

function Boss_Phase11(pUnit, Event)
if pUnit:GetHealthPct() < 5 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
pUnit:RegisterEvent("Boss_Phase11", 1000, 1)
end
end

to

function Boss_Phase11(pUnit, Event)
if pUnit:GetHealthPct() < 5 then
pUnit:SendChatMessage (11, 0, "Taste the flames of Sulfuron!")
pUnit:CastSpell(19780)
end
end
Back to top Go down
View user profile
sufa
Spammer?


Posts: 37
Join date: 2008-04-27

PostSubject: Re: scripting a boss   Mon May 12, 2008 12:01 pm

so i need to delete every pUnit:RegisterEvent("Boss_Phase11", 1000, 1) of the function??
Back to top Go down
View user profile
Darhan
Admin
Admin


Posts: 63
Join date: 2008-04-23

PostSubject: Re: scripting a boss   Mon May 12, 2008 12:29 pm

nope, just edit the last phase like i did,
Back to top Go down
View user profile
sufa
Spammer?


Posts: 37
Join date: 2008-04-27

PostSubject: Re: scripting a boss   Mon May 12, 2008 12:46 pm

ok thx i will try it
Back to top Go down
View user profile
 

scripting a boss

View previous topic View next topic Back to top 
Page 1 of 1

Permissions of this forum:You cannot reply to topics in this forum
LUA Area Scripting Project :: General :: Support! If you want to ask anything, do it here-
Post new topic   Reply to topic