MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides  
Homepage Register FAQ Members Mark Forums Read Advertise Marketplace FPSowned


Go Back   MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides > WoW Emulator Server > Emulator Server Discussion
Reload this Page LUA Scripting Problem
Emulator Server Discussion World of Warcraft Emulator Server general chat .
[NO Questions here]

Reply
 
LinkBack Thread Tools
LUA Scripting Problem
(#1)
Old
Knife's Avatar
Knife is Offline
Knight-Lieutenant
Rep Power: 1
Reputation: 44
Knife is on a distinguished road
 
Posts: 238
Join Date: Dec 2007
LUA Scripting Problem - 03-10-2008

Ok so heres my script :
Code:
function Boss_Enrage(pUnit, Event)
    if pUnit:GetHealthPct() < 95 then
    pUnit:FullCastSpell(34670)
    pUnit:SendChatMessage(11, 0, "I have entered the combat...Prepare to die")
    pUnit:RegisterEvent("Boss_Shadow_Bolt",10000, 0)
end
end

function Boss_Shadow_Bolt(pUnit, Event) 
    print "Boss Shadow Bolt"
        if pUnit:GetHealthPct() < 70 then
    pUnit:RemoveEvents();
    pUnit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
    pUnit:SendChatMessage(11, 0, "Shadow Bolt on you...Haha Noob")
    pUnit:RegisterEvent("Boss_Thunderclap",20000, 0)
end
end

function Boss_Thunderclap(pUnit, Event)
    print "Boss Thunderclap"
        if pUnit:GetHealthPct() < 50 then
    pUnit:RemoveEvents();
    pUnit:FullCastSpellOnTarget(36706,Unit:GetClosestPlayer())
    pUnit:SendChatMessage(11, 0, "Thunderclap...Feel that you newb")
    pUnit:RegisterEvent("Boss_Void_Bolt",30000, 0)
end
end

function Boss_Void_Bolt(pUnit, Event)
    print "Boss Void Bolt"
        if pUnit:GetHealthPct() < 30 then
    pUnit:RemoveEvents();
    pUnit:FullCastSpellOnTarget(39329,Unit:GetClosestPlayer())
    pUnit:SendChatMessage(11, 0, "Now a good Void Bolt...Muhahaha are you feeling it?")
    pUnit:RegisterEvent("Boss_Shadow_Bolt_2",8000, 0)
end
end

function Boss_Shadow_Bolt_2(pUnit, Event) 
    print "Boss Shadow Bolt 2"      
        if pUnit:GetHealthPct() < 15 then
    pUnit:RemoveEvents();
    pUnit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
    pUnit:SendChatMessage(11, 0, "Again Shadow Bolt on you...You are dead....")
end
end

function Boss_OnCombat(pUnit, Event)
    punit:RegisterEvent("Boss_Enrage",10000,1)
end
end

RegisterUnitEvent(130018,1,"Boss")
I get the error :
Code:
 scripts/BOSS_Grol'Mak.lua Expected '<eof>' expected near 'end'
So whats the problem with my script?


Use the "Search" Button, its not hard
Everyone who helps and contributes

Reply With Quote

Donate to remove ads.
(#2)
Old
vb4evr's Avatar
vb4evr is Offline
Master Sergeant
Rep Power: 2
Reputation: 22
vb4evr is on a distinguished road
 
Posts: 113
Join Date: Oct 2007
03-10-2008

this function
Quote:
function Boss_OnCombat(pUnit, Event)
punit:RegisterEvent("Boss_Enrage",10000,1)
end
end

RegisterUnitEvent(130018,1,"Boss")
remove one end you have too many

EDIT: I think you may have some other problems with your script with regards to Unit:GetClosestPlayer(). I think you will need to have it as pUnit:GetClosestPlayer() as you are passing in pUnit.

Last edited by vb4evr; 03-10-2008 at 11:26 AM..
Reply With Quote
(#3)
Old
Knife's Avatar
Knife is Offline
Knight-Lieutenant
Rep Power: 1
Reputation: 44
Knife is on a distinguished road
 
Posts: 238
Join Date: Dec 2007
03-10-2008

Hmm i found one error :
at this part :
Code:
 			 				function Boss_OnCombat(pUnit, Event)
punit:RegisterEvent("Boss_Enrage",10000,1)
end
end
 
RegisterUnitEvent(130018,1,"Boss")
It should be
Code:
 			 				function Boss_OnCombat(pUnit, Event)
punit:RegisterEvent("Boss_Enrage",10000,1)
end
end
 
RegisterUnitEvent(130018,1,"Boss_OnCombat")
Or?


Use the "Search" Button, its not hard
Everyone who helps and contributes

Reply With Quote
(#4)
Old
vb4evr's Avatar
vb4evr is Offline
Master Sergeant
Rep Power: 2
Reputation: 22
vb4evr is on a distinguished road
 
Posts: 113
Join Date: Oct 2007
03-10-2008

No it should be

Code:
function Boss_OnCombat(pUnit, Event)
punit:RegisterEvent("Boss_Enrage",10000,1)
end
RegisterUnitEvent(130018,1,"Boss")
Reply With Quote
(#5)
Old
Knife's Avatar
Knife is Offline
Knight-Lieutenant
Rep Power: 1
Reputation: 44
Knife is on a distinguished road
 
Posts: 238
Join Date: Dec 2007
03-10-2008

I fixed it, it was another problem...i registered events from function to function and changed some things...thanks anyway:P


Use the "Search" Button, its not hard
Everyone who helps and contributes

Reply With Quote
(#6)
Old
vb4evr's Avatar
vb4evr is Offline
Master Sergeant
Rep Power: 2
Reputation: 22
vb4evr is on a distinguished road
 
Posts: 113
Join Date: Oct 2007
03-10-2008

What was the other problem? as your first error was most definitely due to too many ends in the OnCombat function
Reply With Quote
(#7)
Old
Knife's Avatar
Knife is Offline
Knight-Lieutenant
Rep Power: 1
Reputation: 44
Knife is on a distinguished road
 
Posts: 238
Join Date: Dec 2007
03-10-2008

Changed "pUnit" to "Unit"

"unit" to "Unit"

i modified

Code:
function Boss_OnCombat(Unit, Event)
Unit:RegisterEvent("Boss_Enrage",10000,1)
end
end
 
RegisterUnitEvent(130018,1,"Boss")
to
Code:
function Boss_OnCombat(pnit, Event)
Unit:RegisterEvent("Boss_Enrage",10000,1)
end
end
 
RegisterUnitEvent(130018,1,"Boss_OnCombat")
I deleted the ends you sayed


Use the "Search" Button, its not hard
Everyone who helps and contributes

Reply With Quote
(#8)
Old
vb4evr's Avatar
vb4evr is Offline
Master Sergeant
Rep Power: 2
Reputation: 22
vb4evr is on a distinguished road
 
Posts: 113
Join Date: Oct 2007
03-10-2008

Well, not sure what ends you deleted as in my second post I put what the end problem was and what you changed doesn't look like that. But I guess if your script is working that is the important thing. I've added what I think the script should have looked like if you have any other problems.

Code:
function Boss_Enrage(pUnit, Event)
    if pUnit:GetHealthPct() < 95 then
    pUnit:RemoveEvents();
       pUnit:FullCastSpell(34670)
       pUnit:SendChatMessage(11, 0, "I have entered the combat...Prepare to die")
       pUnit:RegisterEvent("Boss_Shadow_Bolt",10000, 0)
    end
end
function Boss_Shadow_Bolt(pUnit, Event) 
    print "Boss Shadow Bolt"
    if pUnit:GetHealthPct() < 70 then
       pUnit:RemoveEvents();
       pUnit:FullCastSpellOnTarget(29924,pUnit:GetClosestPlayer())
       pUnit:SendChatMessage(11, 0, "Shadow Bolt on you...Haha Noob")
       pUnit:RegisterEvent("Boss_Thunderclap",20000, 0)
    end
end
function Boss_Thunderclap(pUnit, Event)
    print "Boss Thunderclap"
    if pUnit:GetHealthPct() < 50 then
       pUnit:RemoveEvents();
       pUnit:FullCastSpellOnTarget(36706,pUnit:GetClosestPlayer())
       pUnit:SendChatMessage(11, 0, "Thunderclap...Feel that you newb")
       pUnit:RegisterEvent("Boss_Void_Bolt",30000, 0)
    end
end
function Boss_Void_Bolt(pUnit, Event)
    print "Boss Void Bolt"
    if pUnit:GetHealthPct() < 30 then
       pUnit:RemoveEvents();
       pUnit:FullCastSpellOnTarget(39329,pUnit:GetClosestPlayer())
       pUnit:SendChatMessage(11, 0, "Now a good Void Bolt...Muhahaha are you feeling it?")
       pUnit:RegisterEvent("Boss_Shadow_Bolt_2",8000, 0)
    end
end
function Boss_Shadow_Bolt_2(pUnit, Event) 
    print "Boss Shadow Bolt 2"      
    if pUnit:GetHealthPct() < 15 then
       pUnit:RemoveEvents();
       pUnit:FullCastSpellOnTarget(29924,pUnit:GetClosestPlayer())
       pUnit:SendChatMessage(11, 0, "Again Shadow Bolt on you...You are dead....")
    end
end
function Boss_OnCombat(pUnit, Event)
    pUnit:RegisterEvent("Boss_Enrage",10000,1)
end
RegisterUnitEvent(130018,1,"Boss")
Reply With Quote
(#9)
Old
Knife's Avatar
Knife is Offline
Knight-Lieutenant
Rep Power: 1
Reputation: 44
Knife is on a distinguished road
 
Posts: 238
Join Date: Dec 2007
03-10-2008

Man thanks for help, it worked and seems i dont have any other problems :P, i have another question now, how can i make the mob cast more spells in a phase? So in Shadow Bolt Phase i want the Boss to cast more Shadow Bolts not only one


Use the "Search" Button, its not hard
Everyone who helps and contributes

Reply With Quote
(#10)
Old
vb4evr's Avatar
vb4evr is Offline
Master Sergeant
Rep Power: 2
Reputation: 22
vb4evr is on a distinguished road
 
Posts: 113
Join Date: Oct 2007
03-10-2008

I would do something like this
Code:
local nSpell = math.random(0,2)
if (nSpell == 0) then
   pUnit:FullCastSpellOnTarget(29924,pUnit:GetClosestPlayer())
elseif (nSpell == 1) then
  (put some other spell here)
else
      (put some other spell here)
end
this would generate a random between 0 and 2 number and cast that spell. Change the random number to suit your needs.
So for instance in your shadow bolt phase it would cast one of 3 spells every 10 seconds.

Last edited by vb4evr; 03-10-2008 at 12:52 PM..
Reply With Quote
(#11)
Old
Knife's Avatar
Knife is Offline
Knight-Lieutenant
Rep Power: 1
Reputation: 44
Knife is on a distinguished road
 
Posts: 238
Join Date: Dec 2007
03-10-2008

I change to that cuz with yours were not loading
Code:
    local nSpell = math.random(0,2)
    if (nSpell == 0) then
        Unit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
    elseif (nSpell == 1) then
      Unit:FullCastSepllOnTarget(29924,Unit:GetClosestPlayer())
    else
      Unit:FullCastSepllOnTarget(29924,Unit:GetClosestPlayer())
end
Il try now in game and see if it works or not

EDIT : lol the boss dont works anymore now


Use the "Search" Button, its not hard
Everyone who helps and contributes

Reply With Quote
(#12)
Old
vb4evr's Avatar
vb4evr is Offline
Master Sergeant
Rep Power: 2
Reputation: 22
vb4evr is on a distinguished road
 
Posts: 113
Join Date: Oct 2007
03-10-2008

How doesn't the boss work?

Edit... there are some other things that I am seeing that I am wondering about. Think about your logic and what you want the boss to do. If you are wanting the boss to enter combat and just tank till it hits 95% cast spell 34670 then at 70% start casting shadow bolt every 10 seconds until it hits the Thunderclap phase? Is this correct? If so... I would do that like this.

Code:
function Boss_Enrage(pUnit, Event)
    if pUnit:GetHealthPct() < 95 then
    pUnit:RemoveEvents();
       pUnit:FullCastSpell(34670)
       pUnit:SendChatMessage(11, 0, "I have entered the combat...Prepare to die")
       pUnit:RegisterEvent("Boss_Shadow_Bolt",3000, 0)
    end
end
function Boss_Shadow_Bolt(pUnit, Event) 
    print "Boss Shadow Bolt"
    if pUnit:GetHealthPct() < 70 then
       pUnit:RemoveEvents();
       pUnit:RegisterEvent("ShadowBoltCast",10000,0)
       pUnit:RegisterEvent("Boss_Thunderclap",20000, 0)
    end
end
function ShadowBoltCast(pUnit,Event)
 pUnit:FullCastSpellOnTarget(29924,pUnit:GetClosestPlayer())
    pUnit:SendChatMessage(11, 0, "Shadow Bolt on you...Haha Noob")
end
 
function Boss_OnCombat(pUnit, Event)
    pUnit:RegisterEvent("Boss_Enrage",10000,1)
end
RegisterUnitEvent(130018,1,"Boss_OnCombat")
This is not the full code but a change to the first phase. (I want you to see what the difference is and figure out how you would proceed for the rest.
Basically the logic is this...
1) BOss enters combat, checks the even Boss enrage every 10seconds
2) Enter Boss_Enrage section at 95% health cast the spell 34670, send message and check the Boss_Shadow_Bolt_Section every 3 seconds
3) Enter Boss_Shadow_Bolt_Section at less then 70% health and check the ShadowBoltCast section every 10 seconds which will trigger your ShadowBolt Cast and message.
4) Check Boss_Thunderclap phase every 20 seconds.

Last edited by vb4evr; 03-10-2008 at 01:24 PM..
Reply With Quote
(#13)
Old
Knife's Avatar
Knife is Offline
Knight-Lieutenant
Rep Power: 1
Reputation: 44
Knife is on a distinguished road
 
Posts: 238
Join Date: Dec 2007
03-10-2008

He dont cast anything anymore....dont say anything anymore


Use the "Search" Button, its not hard
Everyone who helps and contributes

Reply With Quote
(#14)
Old
vb4evr's Avatar
vb4evr is Offline
Master Sergeant
Rep Power: 2
Reputation: 22
vb4evr is on a distinguished road
 
Posts: 113
Join Date: Oct 2007
03-10-2008

See my code above. If still not functioning please post your script at this point
Reply With Quote
(#15)
Old
Knife's Avatar
Knife is Offline
Knight-Lieutenant
Rep Power: 1
Reputation: 44
Knife is on a distinguished road
 
Posts: 238
Join Date: Dec 2007
03-10-2008

Thats my script now : (very huge i know, im good )
Code:
function Boss_Enrage(Unit, Event)
       if Unit:GetHealthPct() < 95 then
       Unit:RemoveEvents();
       Unit:FullCastSpell(34670)
       Unit:SendChatMessage(11, 0, "I have entered the combat...Prepare to die")
       Unit:RegisterEvent("Boss_Shadow_Bolt",3000, 0)
end
end

function Boss_Shadow_Bolt(Unit, Event) 
       print "Boss Shadow Bolt"
       if Unit:GetHealthPct() < 80 then
       Unit:RemoveEvents();
       Unit:RegisterEvent("ShadowBoltCast",5000,0)
       Unit:RegisterEvent("Boss_Thunderclap",5000, 0)
end
end

function ShadowBoltCast(Unit,Event)
    Unit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
    Unit:SendChatMessage(11, 0, "Shadow Bolt on you...Haha Noob")
end

function Boss_Thunderclap(Unit, Event)
        if Unit:GetHealthPct() < 60 then
    Unit:RemoveEvents()
    Unit:RegisterEvent("ThunderclapCast",10000, 0)
    Unit:RegisterEvent("Boss_Void_Bolt",7000, 0)

end
end

function ThunderclapCast(Unit, Event)
    Unit:FullCastSpellOnTarget(36706,Unit:GetClosestPlayer())
    Unit:SendChatMessage(11, 0, "Thunderclap...Feel that you newb")
end

function Boss_Void_Bolt(Unit, Event)
        if Unit:GetHealthPct() < 50 then
    Unit:RemoveEvents()
    Unit:RegisterEvent("VoidBoltCast",10000, 0)
    Unit:RegisterEvent("Boss_Shadow_Bolt_2",5000, 0)
end

function VoidBoltCast(Unit, Event)
    Unit:FullCastSpellOnTarget(39329,Unit:GetClosestPlayer())
    Unit:SendChatMessage(11, 0, "Now a good Void Bolt...Muhahaha are you feeling it?")
end
end

function Boss_Shadow_Bolt_2(Unit, Event)       
        if Unit:GetHealthPct() < 40 then
    Unit:RemoveEvents()
    Unit:RegisterEvent("ShadowBoltCast1",10000, 0)
    Unit:RegisterEvent("Boss_Water_Bolt",3000, 0)
end
end

function ShadowBoltCast1(Unit, Event)
    Unit:FullCastSpellOnTarget(29924,Unit:GetClosestPlayer())
    Unit:SendChatMessage(11, 0, "Again Shadow Bolt on you...You are dead....")
end

function Boss_Water_Bolt(Unit, Event)
    if Unit:GetHealthPct() < 30 then
    Unit:RemoveEvents()
    Unit:RegisterEvent("WaterBoltCast",10000, 0)
    Unit:RegisterEvent("Boss_Stun",2000, 0)
end
end

function WaterBoltCast(Unit, Event)
    Unit:FullCastSpellOnTarget(31012,Unit:GetClosestPlayer())
    Unit:SendChatMessage(11, 0, "Hehe, drink some water, Newb !!!!!!!")
end

function Boss_Stun(Unit, Event)
    if Unit:GetHealthPct() < 20 then
    Unit:RemoveEvents()
    Unit:RegisterEvent("StunCast",10000, 0)
    Unit:RegisterEvent("Boss_Wave",1000, 0)
end
end

function StunCast(Unit, Event)
    Unit:FullCastSpellOnTarget(20170,Unit:GetClosestPlayer())
    Unit:SendChatMessage(11, 0, "Umm, what happened? Cannot move? Hahahahaa.....")
end

function Boss_Wave(Unit, Event)
        if Unit:GetHealthPct() < 15 then
    Unit:RemoveEvents()
    Unit:RegisterEvent("WaveCast",10000, 0)
    Unit:RegisterEvent("Boss_Hellfire",1000, 0)
end
end

function WaveCast(Unit, Event)
    Unit:FullCastSpellOnTarget(36278,Unit:GetClosestPlayer())
    Unit:SendChatMessage(11, 0, "Lets wave, you NOOB........")
end

function Boss_Hellfire(Unit, Event)
    if Unit:GetHealthPct() < 10 then
    Unit:RemoveEvents()
    Unit:RegisterEvent("HellfireCast",10000, 0)
    Unit:RegisterEvent("Boss_Holy_Ground",1000, 0)
end
end

function HellFireCast(Unit, Event)
    Unit:FullCastSpellOnTarget(43465,Unit:GetClosestPlayer())
    Unit:SendChatMessage(11, 0, "Cannot kill me noobs, BURN!!!!!!")
end

function Boss_Holy_Ground(Unit, Event)
    if Unit:GetHealthPct() < 5 then
    Unit:RemoveEvents()
    Unit:RegisterEvent("HolyGroundCast",10000, 0)
end
end

function HolyGroundCast(Unit, Event)
    Unit:FullCastSpellOnTarget(29512,Unit:GetClosestPlayer())
    Unit:SendChatMessage(11, 0, "And for the finish take a Holy Spell.....")
end


function Boss_OnCombat(Unit, Event)
    Unit:RegisterEvent("Boss_Enrage",7000,1)

end

RegisterUnitEvent(130018,1,"Boss_OnCombat")
Semms working for the Shadow bolt but for the others not...have i doed something wrong?


Use the "Search" Button, its not hard
Everyone who helps and contributes

Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347