Really really really really REALLY sorry to bump this, but some of the scripting methods in this guide (i know you didnt make it, but im gonna point out to everyone that reads it) are considered unsafe and old, im going to give you an example.
Code:
local intCreatureAddDeadTrigger = 0
local intPhaseOneCount = 0
function Creature_OnCombat(Unit, Event)
Unit:SendChatMessage(41, 0, "The creature awakens.")
Unit:RegisterEvent("Creature_PhaseOne", 1000, 1)
Unit:SpawnCreature(NPCID, x, y, z, o, 14, 0)
end
function Creature_PhaseOne(Unit, Event)
intPhaseOneCount = intPhaseOneCount + 1
if (intPhaseOneCount == 15) then
-- After 15 seconds he'll do this and so on...
elseif (intPhaseOneCount == 30) then
-- and so on...
elseif (intPhaseOneCount == 35) then
-- ... and so on...
elseif (intPhaseOneCount == 50) then
-- On your last event you want to happen, set intPhaseOneCount back to 0 so it will continue to loop the events above.
end
if (intCreatureAddDeadTrigger == 1) then
Unit:RegisterEvent("Creature_PhaseTwo", 1000, 1)
else
Unit:RegisterEvent("Creature_PhaseOne", 1000, 1)
end
end
function Creature_PhaseTwo(Unit, Event)
-- awmahgawd phase 2.
end
function CreatureAdd_OnDied(Unit, Event)
intCreatureAddDeadTrigger = 1
end
RegisterUnitEvent(NPCID, 4, "CreatureAdd_OnDied")
RegisterUnitEvent(NPCID, 1, "Creature_OnCombat")
Now, as these
Code:
local intCreatureAddDeadTrigger = 0
Code:
local intPhaseOneCount = 0
are not in a function, and are subjected to change, they would cause a huge collide.
going to copy another persons guide about collision here, so you noobs that dont know what it is should understand. (This is not from mmopro)
So every single new script I have seen released always has the same few people commenting with the same defense to say the script is broken.
Lets make it clear that you fail to understand collision. I am going to make this as clear as possible for you.
Code:
function Collide_Event(pUnit, event)
IWillCollide = pUnit
end
That will collide.
Code:
function Collide_Event(pUnit, event)
Code:
local id = pUnit:GetInstanceID()
end
That will not collide.
Now enough of this OMG YOUR SCRIPT IS BROKZED BECUZ COLLIZE when you fail to even understand how collision works.
If a variable is declared on actual loading of the script like the first box it will collide if a unit in another instance is using it, NOT if a local one is declared within a function. If a Global one is declared within a function then it will collide also.
So take off your KnowItAll Caps and reread the tutorials before you "criticize" another person when you yourself don't know thou ass from thine elbow when it comes to collision.
So that is why some things this tutorial is teaching out is wrong, this is the old way of scripting and i suggest everyone go learn the new way.
PS, this post is broken because when i click preview it seems to automaticly add alot of things like CODE /CODE
Bookmarks