Error in script menu

User Tag List

Results 1 to 7 of 7
  1. #1
    towaly's Avatar Corporal
    Reputation
    1
    Join Date
    Aug 2010
    Posts
    19
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error in script

    Here is a quick script i wrote for my npc The Lich King and his entry id is 99909 so how come when i attack him he does not say wat he is supposed to say and also do i have to apply it specifically to the npc lol just general help also tell me if i scripted it wrong


    local npcid = 99909

    Function The Lich King_Begincombat(pUnit, Event)
    pUnit:Sendchatmessage(14, 7 "Who dares oppose The Lich King!")
    end

    Function The Lich King_MirrorImage(pUnit, Event)
    pUnit:Castspell(55342)
    pUnit:Sendchatmessage(14, 7 "The end is near!")
    end

    Function The Lich King_Death(pUnit, Event)
    pUnit:Sendchatmessage(14, 0 "Someone must sit upon the throne.")
    end

    RegisterUnitEvent(99909, 1, "The Lich King_Begincombat")
    RegisterUnitEvent(99909, 2, "The Lich King_MirrorImage")
    RegisterUnitEvent(99909, 3, "The Lich King_MirrorImage")
    Last edited by stoneharry; 02-23-2011 at 02:31 PM. Reason: Added Prefix.

    Error in script
  2. #2
    marcelo_20xx's Avatar Active Member
    Reputation
    25
    Join Date
    Sep 2008
    Posts
    165
    Thanks G/R
    2/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    Function The_Lich_King_Death_Begincombat(pUnit, Event)
    pUnit:Sendchatmessage(14, 7 "Who dares oppose The Lich King!")
    end
    
    Function The_Lich_King_Death_MirrorImage(pUnit, Event)
    pUnit:Castspell(55342)
    pUnit:Sendchatmessage(14, 7 "The end is near!")
    end
    
    Function The_Lich_King_Death(pUnit, Event) //you cant have spaces in function names use "_"
    pUnit:Sendchatmessage(14, 0 "Someone must sit upon the throne.")
    end
    
    RegisterUnitEvent(99909, 1, "The_Lich_King_Death_Begincombat") //change 99909 to the entry number of the npc you are scripting 
    RegisterUnitEvent(99909, 2, "The_Lich_King_Death_MirrorImage")
    RegisterUnitEvent(99909, 3, "The_Lich_King_Death_MirrorImage")
    Last edited by marcelo_20xx; 08-06-2010 at 02:32 AM.

  3. #3
    Kiev's Avatar Contributor
    Reputation
    288
    Join Date
    Nov 2007
    Posts
    1,819
    Thanks G/R
    0/4
    Trade Feedback
    3 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sendchatmessage should be SendChatMessage.




  4. #4
    darkdoog12's Avatar Private
    Reputation
    1
    Join Date
    Jan 2011
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lich King encounter full script (maded by darkdoog12)

    Code:
    -------LEAVE COMBAT FUNCTIONS------
    
    function lichking2_OnLeaveCombat (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "You were weaker then i thought.")
    pUnit:RemoveEvents()
    end
    
    function lichking1_OnLeaveCombat (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "You were weaker then i thought.")
    pUnit:RemoveEvents()
    end
    
    function lichkingsgargoyle_OnLeaveCombat (pUnit, Event)
    pUnit:Despawn(1, 0)
    end
    
    function bealokblood_OnLeaveCombat (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "ALL HAIL THE LICH KING!")
    pUnit:Despawn(1, 0)
    end
    
    function sapphfrost_OnLeaveCombat (pUnit, Event)
    pUnit:Despawn(1, 0)
    end
    
    function rokirunholy_OnLeaveCombat (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "Did you really think you had a chance?")
    pUnit:Despawn(1, 0)
    end
    
    function rokirsghoul_OnLeaveCombat (pUnit, Event)
    pUnit:Despawn(1, 0)
    end
    
    -----END OF LEAVECOMBAT FUNCTIONS------
    
    ---------ONDIED FUNCTIONS-------
    function rokirsghoul_OnDied (pUnit, Event)
    pUnit:RemoveEvents()
    pUnit:Despawn(1, 0)
    end
    
    function lichking2_OnDied (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "You did this in vain! i will rise again!")
    pUnit:RemoveEvents()
    end
    
    function rokirunholy_OnDied (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "This cannot be... the.. end.")
    x = pUnit:GetX()
    y = pUnit:GetY()
    z = pUnit:GetZ()
    o = pUnit:GetO()
    pUnit:SpawnCreature(300114, x, y, z, o, 14, 0)
    pUnit:RemoveEvents()
    pUnit:Despawn(1, 0)
    end
    
    function sapphfrost_OnDied (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "My work here is done.")
    pUnit:RegisterEvent("frostnova", 1, 1)
    pUnit:RemoveEvents()
    pUnit:SpawnCreature(30954, x, y, z, o, 14, 0)
    pUnit:Despawn(1, 0)
    end
    
    function bealokblood_OnDied (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "LICH KING WILL CRUSH YOU!!")
    pUnit:RemoveEvents()
    pUnit:SpawnCreature(30956, x, y, z, o, 14, 0)
    pUnit:Despawn(1, 0)
    end
    
    function lichkingsgargoyle_OnDied (pUnit, Event)
    pUnit:RemoveEvents()
    pUnit:Despawn(1, 0)
    end
    
    -----END OF ONDIED FUNCTIONS------
    
    ------LICH KINGS GARGOYLE-------
    
    function lichkingsgargoyle_OnCombat (pUnit, Event)
    pUnit:SetFlying()
    pUnit:SetMovementType(768)
    pUnit:RegisterEvent("gargoylebeam", 2000, 0)
    end
    
    RegisterUnitEvent(17906, 1, "lichkingsgargoyle_OnCombat")
    RegisterUnitEvent(17906, 2, "lichkingsgargoyle_OnLeaveCombat")
    RegisterUnitEvent(17906, 4, "lichkingsgargoyle_OnDied")
    
    -----END OF LICHKINGS GARGOYLE------
    
    -------BEALOK BLOOD DEATHKNIGHT-------
    
    function bealokblood_OnCombat (pUnit, Event)
    pUnit:SetCombatCapable(0)
    pUnit:SetCombatTargetingCapable(0)
    pUnit:SetFaction(14)
    pUnit:SendChatMessage(14, 0, "Ill eat your heart!!!")
    pUnit:CastSpell(55212)
    pUnit:RegisterEvent("hysteria", 12000, 0)
    pUnit:RegisterEvent("heartstrike", 4000, 0)
    pUnit:RegisterEvent("deathcoil", 12000, 0)
    pUnit:RegisterEvent("deathstrike", 20000, 0)
    end
    
    RegisterUnitEvent(30953, 1, "bealokblood_OnCombat")
    RegisterUnitEvent(30953, 2, "bealokblood_OnLeaveCombat")
    RegisterUnitEvent(30953, 4, "bealokblood_OnDied")
    
    ----------END OF BEALOK-------------
    
    ----------ROKIR THE UNHOLY DEATHKNIGHT------
    
    function rokirunholy_OnCombat (pUnit, Event)
    x = pUnit:GetX()
    y = pUnit:GetY()
    z = pUnit:GetZ()
    o = pUnit:GetO()
    pUnit:SpawnCreature(27534, x, y, z, o, 14, 0)
    pUnit:SetFaction(14)
    pUnit:SendChatMessage(14, 0, "Welcome to the realm of pain!")
    pUnit:CastSpell(55222)
    pUnit:CastSpell(49222)
    pUnit:RegisterEvent("boneshield", 10000, 0)
    pUnit:RegisterEvent("scourgestrike", 5000, 0)
    pUnit:RegisterEvent("plaguestrike", 30000, 0)
    pUnit:RegisterEvent("carrionswarm", 12000, 0)
    pUnit:RegisterEvent("antimagicshell", 15000, 0)
    pUnit:RegisterEvent("unholyblight", 8000, 0)
    end
    
    RegisterUnitEvent(30954, 1, "rokirunholy_OnCombat")
    RegisterUnitEvent(30954, 2, "rokirunholy_OnLeaveCombat")
    RegisterUnitEvent(30954, 4, "rokirunholy_OnDied")
    
    ------END OF ROKIR------
    
    ----------SAPPH FROST DEATHKNIGHT-------
    
    function sapphfrost_OnCombat (pUnit, Event)
    pUnit:SetFaction(14)
    pUnit:CastSpell(58130)
    pUnit:CastSpell(51271)
    pUnit:CastSpell(57623)
    pUnit:RegisterEvent("icytouch", 8000, 0)
    pUnit:RegisterEvent("unbreakablearmor", 20000, 0)
    pUnit:RegisterEvent("freezeinplace", 22000, 0)
    pUnit:SendChatMessage(14, 0, "I will shatter your spine when i freeze it.")
    end
    
    
    RegisterUnitEvent(30956, 1, "sapphfrost_OnCombat")
    RegisterUnitEvent(30956, 2, "sapphfrost_OnLeaveCombat")
    RegisterUnitEvent(30956, 4, "sapphfrost_OnDied")
    
    -----END OF SAPPH------
    
    -------------ROKIRS GHOUL--------------
    
    function rokirsghoul_OnCombat (pUnit, Event)
    pUnit:SetCombatCapable(0)
    pUnit:SetCombatTargetingCapable(0)
    pUnit:SetFaction(14)
    pUnit:RegisterEvent("ghoulgnaw", math.random(30000,27000), 0)
    pUnit:RegisterEvent("ghoulexplode", 1000, 0)
    pUnit:RegisterEvent("ghoulbite", 3000, 0)
    end
    
    function ghoulexplode (pUnit, Event)
    if pUnit:GetHealthPct() < 19 then
    pUnit:CastSpell(26059)
    end
    end
    
    
    RegisterUnitEvent(27534, 1, "rokirsghoul_OnCombat")
    RegisterUnitEvent(27534, 2, "rokirsghoul_OnLeaveCombat")
    RegisterUnitEvent(27534, 4, "rokirsghoul_OnDied")
    
    ------END OF ROKIRS GHOUL------
    
    ---------------LICH KING---------------
    
    function lichking1_OnCombat (pUnit, Event)
    pUnit:SetCombatCapable(1)
    pUnit:SetCombatTargetingCapable(1)
    pUnit:SetFaction(35)
    pUnit:RegisterEvent("lichking1start", 8000, 1)
    pUnit:RegisterEvent("lichking1talk", 1, 1)
    pUnit:RegisterEvent("lichking1talk2", 2440, 1)
    pUnit:RegisterEvent("lichking1talk3", 5440, 1)
    end
    
    function lichking1start (pUnit, Event)
    pUnit:SetCombatCapable(0)
    pUnit:SetCombatTargetingCapable(0)
    pUnit:SetFaction(14)
    pUnit:RegisterEvent("deathgrip", 20000, 0)
    pUnit:RegisterEvent("icytouch", 8000, 0)
    pUnit:RegisterEvent("strangulate", 18000, 0)
    pUnit:RegisterEvent("runestrike", 9231, 0)
    pUnit:RegisterEvent("lichking1phase2", 1000, 0)
    end
    
    function lichking1phase2 (pUnit, event)
    if pUnit:GetHealthPct() < 76 then
    pUnit:RemoveEvents()
    pUnit:RegisterEvent("lichking1phase3", 1000, 0)
    pUnit:RegisterEvent("deathgrip", 20000, 0)
    pUnit:RegisterEvent("icytouch", 12000, 0)
    pUnit:RegisterEvent("curseoffatigue", 20000, 0)
    pUnit:RegisterEvent("curseoftwistedflesh", 30000, 0)
    pUnit:RegisterEvent("bloodboil", 15000, 1)
    end
    end
    
    function lichking1phase3 (pUnit, event)
    if pUnit:GetHealthPct() < 50 then
    pUnit:SendChatMessage(14, 0, "Champions! Aid your master!")
    pUnit:RemoveEvents()
    x = pUnit:GetX()
    y = pUnit:GetY()
    z = pUnit:GetZ()
    o = pUnit:GetO()
    pUnit:SpawnCreature(30953, x, y, z, o, 14, 0)
    pUnit:SetCombatCapable(1)
    pUnit:SetCombatTargetingCapable(1)
    pUnit:Despawn(1, 0)
    end
    end
    
    RegisterUnitEvent(300113, 1, "lichking1_OnCombat")
    RegisterUnitEvent(300113, 2, "lichking1_OnLeaveCombat")
    
    ------LICH KING 2 THE AFTER 50%------
    
    function lichking2phase4 (pUnit, Event)
    pUnit:RemoveEvents()
    pUnit:SetCombatCapable(0)
    pUnit:SetCombatTargetingCapable(0)
    pUnit:SetFaction(14)
    pUnit:RegisterEvent("lichking2phase5", 1000, 0)
    pUnit:SendChatMessage(14, 0, "Prepare to taste real pain... Frostmourne hungers!!")
    pUnit:RegisterEvent("paledeath", 15000, 0)
    pUnit:RegisterEvent("icytouch", 6000, 0)
    pUnit:RegisterEvent("bloodboil", 13500, 2)
    pUnit:RegisterEvent("strangulate", 22000, 0)
    pUnit:RegisterEvent("curseoffatigue", 21000, 0)
    pUnit:RegisterEvent("curseoftwistedflesh", 30000, 0)
    pUnit:RegisterEvent("plaguestrike", 9200, 0)
    end
    
    function lichking2phase5 (pUnit, Event)
    if pUnit:GetHealthPct() < 74 then
    pUnit:RemoveEvents()
    pUnit:SetCombatCapable(1)
    pUnit:SetCombatTargetingCapable(1)
    pUnit:SendChatMessage(14, 0, "Come, my minions! Tear them limb from limb!")
    pUnit:CastSpell(30843)
    pUnit:RegisterEvent("cripple", 1000, 1)
    pUnit:RegisterEvent("cripple", 15000, 0)
    pUnit:RegisterEvent("enfeeble", 10000, 0)
    pUnit:RegisterEvent("lichking2talk4", 10000, 1)
    pUnit:RegisterEvent("ghoulsummon", 500, 15)
    pUnit:RegisterEvent("lichking2phase6", 20000, 1)
    end
    end
    
    function lichking2phase6 (pUnit, Event)
    pUnit:SetCombatCapable(0)
    pUnit:SetCombatTargetingCapable(0)
    pUnit:RemoveEvents()
    pUnit:SendChatMessage(14, 0, "Death is nothing to be afraid of!")
    pUnit:RegisterEvent("deathblast", 14000, 0)
    pUnit:RegisterEvent("paledeath", 22000, 0)
    pUnit:RegisterEvent("bloodboil", 14300, 3)
    pUnit:RegisterEvent("blizzard", 20000, 0)
    pUnit:RegisterEvent("frostnova", 19000, 0)
    pUnit:RegisterEvent("lichking2phase7", 1000, 0)
    end
    
    function lichking2phase7 (pUnit, Event)
    if pUnit:GetHealthPct() < 50 then
    pUnit:RemoveEvents()
    pUnit:SendChatMessage(14, 0, "Arise once again my minons!")
    pUnit:RegisterEvent("lichking2phase8", 1000, 0)
    pUnit:RegisterEvent("ghoulsummon", 1000, 6)
    pUnit:RegisterEvent("massfear", 30000, 0)
    pUnit:RegisterEvent("enfeeble", 30000, 0)
    pUnit:RegisterEvent("icytouch", 8000, 0)
    pUnit:RegisterEvent("paledeath", 20000, 0)
    end
    end
    
    function lichking2phase8 (pUnit, Event)
    if pUnit:GetHealthPct() < 25 then
    pUnit:RemoveEvents()
    pUnit:SetCombatCapable(1)
    pUnit:SetCombatTargetingCapable(1)
    pUnit:SendChatMessage(14, 0, "No one can stop me!")
    pUnit:RegisterEvent("gargoylesummon", 500, 6)
    pUnit:RegisterEvent("enfeeble", 1000, 1)
    pUnit:RegisterEvent("enfeeble", 22000, 0)
    pUnit:RegisterEvent("cripple", 5300, 0)
    pUnit:RegisterEvent("lichking2phase9", 30000, 0)
    end
    end
    
    function lichking2phase9 (pUnit, Event)
    pUnit:SetCombatCapable(0)
    pUnit:SetCombatTargetingCapable(0)
    pUnit:SetFaction(14)
    pUnit:RemoveEvents()
    pUnit:SendChatMessage(14, 0, "I will... not... fall!")
    pUnit:RegisterEvent("icytouch", 900, 0)
    pUnit:RegisterEvent("deathblast", 14000, 0)
    pUnit:RegisterEvent("blizzard", 25000, 0)
    pUnit:RegisterEvent("curseoftwistedflesh", 30000, 0)
    end
    
    RegisterUnitEvent(300114, 1, "lichking2phase4")
    RegisterUnitEvent(300114, 2, "lichking2_OnLeaveCombat")
    RegisterUnitEvent(300114, 4, "lichking2_OnDied")
    ------END OF ENCOUNTER-------
    But dunno how to put in trinity repack 3.3.5a
    and if u know please reply me....thx
    Last edited by darkdoog12; 02-21-2011 at 12:25 PM.

  5. #5
    Dynashock's Avatar Contributor

    Reputation
    176
    Join Date
    Nov 2007
    Posts
    203
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by darkdoog12 View Post
    Code:
    -------LEAVE COMBAT FUNCTIONS------
    
    function lichking2_OnLeaveCombat (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "You were weaker then i thought.")
    pUnit:RemoveEvents()
    end
    
    function lichking1_OnLeaveCombat (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "You were weaker then i thought.")
    pUnit:RemoveEvents()
    end
    
    function lichkingsgargoyle_OnLeaveCombat (pUnit, Event)
    pUnit:Despawn(1, 0)
    end
    
    function bealokblood_OnLeaveCombat (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "ALL HAIL THE LICH KING!")
    pUnit:Despawn(1, 0)
    end
    
    function sapphfrost_OnLeaveCombat (pUnit, Event)
    pUnit:Despawn(1, 0)
    end
    
    function rokirunholy_OnLeaveCombat (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "Did you really think you had a chance?")
    pUnit:Despawn(1, 0)
    end
    
    function rokirsghoul_OnLeaveCombat (pUnit, Event)
    pUnit:Despawn(1, 0)
    end
    
    -----END OF LEAVECOMBAT FUNCTIONS------
    
    ---------ONDIED FUNCTIONS-------
    function rokirsghoul_OnDied (pUnit, Event)
    pUnit:RemoveEvents()
    pUnit:Despawn(1, 0)
    end
    
    function lichking2_OnDied (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "You did this in vain! i will rise again!")
    pUnit:RemoveEvents()
    end
    
    function rokirunholy_OnDied (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "This cannot be... the.. end.")
    x = pUnit:GetX()
    y = pUnit:GetY()
    z = pUnit:GetZ()
    o = pUnit:GetO()
    pUnit:SpawnCreature(300114, x, y, z, o, 14, 0)
    pUnit:RemoveEvents()
    pUnit:Despawn(1, 0)
    end
    
    function sapphfrost_OnDied (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "My work here is done.")
    pUnit:RegisterEvent("frostnova", 1, 1)
    pUnit:RemoveEvents()
    pUnit:SpawnCreature(30954, x, y, z, o, 14, 0)
    pUnit:Despawn(1, 0)
    end
    
    function bealokblood_OnDied (pUnit, Event)
    pUnit:SendChatMessage(14, 0, "LICH KING WILL CRUSH YOU!!")
    pUnit:RemoveEvents()
    pUnit:SpawnCreature(30956, x, y, z, o, 14, 0)
    pUnit:Despawn(1, 0)
    end
    
    function lichkingsgargoyle_OnDied (pUnit, Event)
    pUnit:RemoveEvents()
    pUnit:Despawn(1, 0)
    end
    
    -----END OF ONDIED FUNCTIONS------
    
    ------LICH KINGS GARGOYLE-------
    
    function lichkingsgargoyle_OnCombat (pUnit, Event)
    pUnit:SetFlying()
    pUnit:SetMovementType(768)
    pUnit:RegisterEvent("gargoylebeam", 2000, 0)
    end
    
    RegisterUnitEvent(17906, 1, "lichkingsgargoyle_OnCombat")
    RegisterUnitEvent(17906, 2, "lichkingsgargoyle_OnLeaveCombat")
    RegisterUnitEvent(17906, 4, "lichkingsgargoyle_OnDied")
    
    -----END OF LICHKINGS GARGOYLE------
    
    -------BEALOK BLOOD DEATHKNIGHT-------
    
    function bealokblood_OnCombat (pUnit, Event)
    pUnit:SetCombatCapable(0)
    pUnit:SetCombatTargetingCapable(0)
    pUnit:SetFaction(14)
    pUnit:SendChatMessage(14, 0, "Ill eat your heart!!!")
    pUnit:CastSpell(55212)
    pUnit:RegisterEvent("hysteria", 12000, 0)
    pUnit:RegisterEvent("heartstrike", 4000, 0)
    pUnit:RegisterEvent("deathcoil", 12000, 0)
    pUnit:RegisterEvent("deathstrike", 20000, 0)
    end
    
    RegisterUnitEvent(30953, 1, "bealokblood_OnCombat")
    RegisterUnitEvent(30953, 2, "bealokblood_OnLeaveCombat")
    RegisterUnitEvent(30953, 4, "bealokblood_OnDied")
    
    ----------END OF BEALOK-------------
    
    ----------ROKIR THE UNHOLY DEATHKNIGHT------
    
    function rokirunholy_OnCombat (pUnit, Event)
    x = pUnit:GetX()
    y = pUnit:GetY()
    z = pUnit:GetZ()
    o = pUnit:GetO()
    pUnit:SpawnCreature(27534, x, y, z, o, 14, 0)
    pUnit:SetFaction(14)
    pUnit:SendChatMessage(14, 0, "Welcome to the realm of pain!")
    pUnit:CastSpell(55222)
    pUnit:CastSpell(49222)
    pUnit:RegisterEvent("boneshield", 10000, 0)
    pUnit:RegisterEvent("scourgestrike", 5000, 0)
    pUnit:RegisterEvent("plaguestrike", 30000, 0)
    pUnit:RegisterEvent("carrionswarm", 12000, 0)
    pUnit:RegisterEvent("antimagicshell", 15000, 0)
    pUnit:RegisterEvent("unholyblight", 8000, 0)
    end
    
    RegisterUnitEvent(30954, 1, "rokirunholy_OnCombat")
    RegisterUnitEvent(30954, 2, "rokirunholy_OnLeaveCombat")
    RegisterUnitEvent(30954, 4, "rokirunholy_OnDied")
    
    ------END OF ROKIR------
    
    ----------SAPPH FROST DEATHKNIGHT-------
    
    function sapphfrost_OnCombat (pUnit, Event)
    pUnit:SetFaction(14)
    pUnit:CastSpell(58130)
    pUnit:CastSpell(51271)
    pUnit:CastSpell(57623)
    pUnit:RegisterEvent("icytouch", 8000, 0)
    pUnit:RegisterEvent("unbreakablearmor", 20000, 0)
    pUnit:RegisterEvent("freezeinplace", 22000, 0)
    pUnit:SendChatMessage(14, 0, "I will shatter your spine when i freeze it.")
    end
    
    
    RegisterUnitEvent(30956, 1, "sapphfrost_OnCombat")
    RegisterUnitEvent(30956, 2, "sapphfrost_OnLeaveCombat")
    RegisterUnitEvent(30956, 4, "sapphfrost_OnDied")
    
    -----END OF SAPPH------
    
    -------------ROKIRS GHOUL--------------
    
    function rokirsghoul_OnCombat (pUnit, Event)
    pUnit:SetCombatCapable(0)
    pUnit:SetCombatTargetingCapable(0)
    pUnit:SetFaction(14)
    pUnit:RegisterEvent("ghoulgnaw", math.random(30000,27000), 0)
    pUnit:RegisterEvent("ghoulexplode", 1000, 0)
    pUnit:RegisterEvent("ghoulbite", 3000, 0)
    end
    
    function ghoulexplode (pUnit, Event)
    if pUnit:GetHealthPct() < 19 then
    pUnit:CastSpell(26059)
    end
    end
    
    
    RegisterUnitEvent(27534, 1, "rokirsghoul_OnCombat")
    RegisterUnitEvent(27534, 2, "rokirsghoul_OnLeaveCombat")
    RegisterUnitEvent(27534, 4, "rokirsghoul_OnDied")
    
    ------END OF ROKIRS GHOUL------
    
    ---------------LICH KING---------------
    
    function lichking1_OnCombat (pUnit, Event)
    pUnit:SetCombatCapable(1)
    pUnit:SetCombatTargetingCapable(1)
    pUnit:SetFaction(35)
    pUnit:RegisterEvent("lichking1start", 8000, 1)
    pUnit:RegisterEvent("lichking1talk", 1, 1)
    pUnit:RegisterEvent("lichking1talk2", 2440, 1)
    pUnit:RegisterEvent("lichking1talk3", 5440, 1)
    end
    
    function lichking1start (pUnit, Event)
    pUnit:SetCombatCapable(0)
    pUnit:SetCombatTargetingCapable(0)
    pUnit:SetFaction(14)
    pUnit:RegisterEvent("deathgrip", 20000, 0)
    pUnit:RegisterEvent("icytouch", 8000, 0)
    pUnit:RegisterEvent("strangulate", 18000, 0)
    pUnit:RegisterEvent("runestrike", 9231, 0)
    pUnit:RegisterEvent("lichking1phase2", 1000, 0)
    end
    
    function lichking1phase2 (pUnit, event)
    if pUnit:GetHealthPct() < 76 then
    pUnit:RemoveEvents()
    pUnit:RegisterEvent("lichking1phase3", 1000, 0)
    pUnit:RegisterEvent("deathgrip", 20000, 0)
    pUnit:RegisterEvent("icytouch", 12000, 0)
    pUnit:RegisterEvent("curseoffatigue", 20000, 0)
    pUnit:RegisterEvent("curseoftwistedflesh", 30000, 0)
    pUnit:RegisterEvent("bloodboil", 15000, 1)
    end
    end
    
    function lichking1phase3 (pUnit, event)
    if pUnit:GetHealthPct() < 50 then
    pUnit:SendChatMessage(14, 0, "Champions! Aid your master!")
    pUnit:RemoveEvents()
    x = pUnit:GetX()
    y = pUnit:GetY()
    z = pUnit:GetZ()
    o = pUnit:GetO()
    pUnit:SpawnCreature(30953, x, y, z, o, 14, 0)
    pUnit:SetCombatCapable(1)
    pUnit:SetCombatTargetingCapable(1)
    pUnit:Despawn(1, 0)
    end
    end
    
    RegisterUnitEvent(300113, 1, "lichking1_OnCombat")
    RegisterUnitEvent(300113, 2, "lichking1_OnLeaveCombat")
    
    ------LICH KING 2 THE AFTER 50%------
    
    function lichking2phase4 (pUnit, Event)
    pUnit:RemoveEvents()
    pUnit:SetCombatCapable(0)
    pUnit:SetCombatTargetingCapable(0)
    pUnit:SetFaction(14)
    pUnit:RegisterEvent("lichking2phase5", 1000, 0)
    pUnit:SendChatMessage(14, 0, "Prepare to taste real pain... Frostmourne hungers!!")
    pUnit:RegisterEvent("paledeath", 15000, 0)
    pUnit:RegisterEvent("icytouch", 6000, 0)
    pUnit:RegisterEvent("bloodboil", 13500, 2)
    pUnit:RegisterEvent("strangulate", 22000, 0)
    pUnit:RegisterEvent("curseoffatigue", 21000, 0)
    pUnit:RegisterEvent("curseoftwistedflesh", 30000, 0)
    pUnit:RegisterEvent("plaguestrike", 9200, 0)
    end
    
    function lichking2phase5 (pUnit, Event)
    if pUnit:GetHealthPct() < 74 then
    pUnit:RemoveEvents()
    pUnit:SetCombatCapable(1)
    pUnit:SetCombatTargetingCapable(1)
    pUnit:SendChatMessage(14, 0, "Come, my minions! Tear them limb from limb!")
    pUnit:CastSpell(30843)
    pUnit:RegisterEvent("cripple", 1000, 1)
    pUnit:RegisterEvent("cripple", 15000, 0)
    pUnit:RegisterEvent("enfeeble", 10000, 0)
    pUnit:RegisterEvent("lichking2talk4", 10000, 1)
    pUnit:RegisterEvent("ghoulsummon", 500, 15)
    pUnit:RegisterEvent("lichking2phase6", 20000, 1)
    end
    end
    
    function lichking2phase6 (pUnit, Event)
    pUnit:SetCombatCapable(0)
    pUnit:SetCombatTargetingCapable(0)
    pUnit:RemoveEvents()
    pUnit:SendChatMessage(14, 0, "Death is nothing to be afraid of!")
    pUnit:RegisterEvent("deathblast", 14000, 0)
    pUnit:RegisterEvent("paledeath", 22000, 0)
    pUnit:RegisterEvent("bloodboil", 14300, 3)
    pUnit:RegisterEvent("blizzard", 20000, 0)
    pUnit:RegisterEvent("frostnova", 19000, 0)
    pUnit:RegisterEvent("lichking2phase7", 1000, 0)
    end
    
    function lichking2phase7 (pUnit, Event)
    if pUnit:GetHealthPct() < 50 then
    pUnit:RemoveEvents()
    pUnit:SendChatMessage(14, 0, "Arise once again my minons!")
    pUnit:RegisterEvent("lichking2phase8", 1000, 0)
    pUnit:RegisterEvent("ghoulsummon", 1000, 6)
    pUnit:RegisterEvent("massfear", 30000, 0)
    pUnit:RegisterEvent("enfeeble", 30000, 0)
    pUnit:RegisterEvent("icytouch", 8000, 0)
    pUnit:RegisterEvent("paledeath", 20000, 0)
    end
    end
    
    function lichking2phase8 (pUnit, Event)
    if pUnit:GetHealthPct() < 25 then
    pUnit:RemoveEvents()
    pUnit:SetCombatCapable(1)
    pUnit:SetCombatTargetingCapable(1)
    pUnit:SendChatMessage(14, 0, "No one can stop me!")
    pUnit:RegisterEvent("gargoylesummon", 500, 6)
    pUnit:RegisterEvent("enfeeble", 1000, 1)
    pUnit:RegisterEvent("enfeeble", 22000, 0)
    pUnit:RegisterEvent("cripple", 5300, 0)
    pUnit:RegisterEvent("lichking2phase9", 30000, 0)
    end
    end
    
    function lichking2phase9 (pUnit, Event)
    pUnit:SetCombatCapable(0)
    pUnit:SetCombatTargetingCapable(0)
    pUnit:SetFaction(14)
    pUnit:RemoveEvents()
    pUnit:SendChatMessage(14, 0, "I will... not... fall!")
    pUnit:RegisterEvent("icytouch", 900, 0)
    pUnit:RegisterEvent("deathblast", 14000, 0)
    pUnit:RegisterEvent("blizzard", 25000, 0)
    pUnit:RegisterEvent("curseoftwistedflesh", 30000, 0)
    end
    
    RegisterUnitEvent(300114, 1, "lichking2phase4")
    RegisterUnitEvent(300114, 2, "lichking2_OnLeaveCombat")
    RegisterUnitEvent(300114, 4, "lichking2_OnDied")
    ------END OF ENCOUNTER-------
    But dunno how to put in trinity repack 3.3.5a
    and if u know please reply me....thx
    You cannot use Lua scripts on TrinityCore. TrinityCore only supports C++ and database (through either EAI or SAI) scripts.
    Ignorance is bliss.

  6. #6
    newtech's Avatar Active Member
    Reputation
    57
    Join Date
    Aug 2008
    Posts
    308
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, so basically this should work perfect (if you have LuaHypArc, ofcourse)

    Code:
    local npcid = 99909
    local m_i_waittime = 30000
    --                     ^
    -- Write here in miliseconds the time you want to pass after
    -- entering combat, till you want him to cast mirror image.
    
    function The_Lich_King_Begincombat(pUnit, Event)
    	pUnit:Sendchatmessage(14, 7 "Who dares oppose The Lich King!")
    	pUnit:RegisterEvent("The_Lich_King_MirrorImage", m_i_waittime, 1)
    end
    
    function The_Lich_King_MirrorImage(pUnit, Event)
    	pUnit:Castspell(55342)
    	pUnit:Sendchatmessage(14, 7 "The end is near!")
    end
    
    function The_Lich_King_Death(pUnit, Event)
    	pUnit:Sendchatmessage(14, 0 "Someone must sit upon the throne.")
    end
    
    RegisterUnitEvent(npcid, 1, "The_Lich_King_Begincombat")
    RegisterUnitEvent(npcid, 4, "The_Lich_King_Death")
    I spotted quite a few errors in it, so I cba to list them all, but if you want to know them, feel free to PM me and ask.

    Thanks
    Newtech
    LuaHypArc Lua scripter - 3.3.5a World Builder.

  7. #7
    darkdoog12's Avatar Private
    Reputation
    1
    Join Date
    Jan 2011
    Posts
    5
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    INSERT INTO script_texts (entry,content_default,content_loc1,content_loc2,content_loc3,content_loc4,content_loc5,content_loc6,content_loc7,content_loc8,sound,type,language,emote,comment)VALUES
    (-1810001, 'So...the Light\'s vaunted justice has finally arrived. Shall I lay down Frostmourne and throw myself at your mercy, Fordring?',null,null,null,null,null,null,null,null,17349,1,0,0,''),
    (-1810002, 'We will grant you a swift death, Arthas. More than can be said for the thousands you\'ve tortured and slain.',null,null,null,null,null,null,null,null,17390,1,0,0,''),
    (-1810003, 'You will learn of that first hand. When my work is complete, you will beg for mercy -- and I will deny you. Your anguished cries will be testament to my unbridled power.',null,null,null,null,null,null,null,null,17350,1,0,0,''),
    (-1810004, 'So be it. Champions, attack!',null,null,null,null,null,null,null,null,17391,1,0,0,''),
    (-1810005, 'I\'ll keep you alive to witness the end, Fordring. I would not want the Light\'s greatest champion to miss seeing this wretched world remade in my image.',null,null,null,null,null,null,null,null,17351,1,0,0,''),
    (-1810006, 'Come then champions, feed me your rage!',null,null,null,null,null,null,null,null,17352,1,0,0,''),
    (-1810007, 'I will freeze you from within until all that remains is an icy husk!',null,null,null,null,null,null,null,null,17369,1,0,0,''),
    (-1810008, 'Apocalypse!',null,null,null,null,null,null,null,null,17371,1,0,0,''),
    (-1810009, 'Bow down before your lord and master!',null,null,null,null,null,null,null,null,17372,1,0,0,''),
    (-1810010, 'Hope wanes!',null,null,null,null,null,null,null,null,17363,1,0,0,''),
    (-1810011, 'The end has come!',null,null,null,null,null,null,null,null,17364,1,0,0,''),
    (-1810012, 'Face now your tragic end!',null,null,null,null,null,null,null,null,17365,1,0,0,''),
    (-1810013, 'No question remains unanswered. No doubts linger. You are Azeroth\'s greatest champions! You overcame every challenge I laid before you. My mightiest servants have fallen before your relentless onslaught, your unbridled fury... Is it truly righteousness that drives you? I wonder.',null,null,null,null,null,null,null,null,17353,1,0,0,''),
    (-1810014, 'You trained them well, Fordring. You delivered the greatest fighting force this world has ever known... right into my hands -- exactly as I intended. You shall be rewarded for your unwitting sacrifice.',null,null,null,null,null,null,null,null,17355,1,0,0,''),
    (-1810015, 'Watch now as I raise them from the dead to become masters of the Scourge. They will shroud this world in chaos and destruction. Azeroth\'s fall will come at their hands -- and you will be the first to die.',null,null,null,null,null,null,null,null,17356,1,0,0,''),
    (-1810016, 'I delight in the irony.',null,null,null,null,null,null,null,null,17357,1,0,0,''),
    (-1810017, 'LIGHT, GRANT ME ONE FINAL BLESSING. GIVE ME THE STRENGTH... TO SHATTER THESE BONDS!',null,null,null,null,null,null,null,null,17392,1,0,0,''),
    (-1810018, 'Impossible...',null,null,null,null,null,null,null,null,17358,1,0,0,''),
    (-1810019, '',null,null,null,null,null,null,null,null,17360,1,0,0,''),
    (-1810020, 'No more, Arthas! No more lives will be consumed by your hatred!',null,null,null,null,null,null,null,null,17393,1,0,0,''),
    (-1810021, 'Free at last! It is over, my son. This is the moment of reckoning.',null,null,null,null,null,null,null,null,17397,1,0,0,''),
    (-1810022, 'The Lich King must fall!',null,null,null,null,null,null,null,null,17389,1,0,0,''),
    (-1810023, 'Rise up, champions of the Light!',null,null,null,null,null,null,null,null,17398,1,0,0,''),
    (-1810024, 'Now I stand, the lion before the lambs... and they do not fear.',null,null,null,null,null,null,null,null,17361,1,0,0,''),
    (-1810025, 'They cannot fear.',null,null,null,null,null,null,null,null,17362,1,0,0,''),
    (-1810026, 'Argh... Frostmourne, obey me!',null,null,null,null,null,null,null,null,17367,1,0,0,''),
    (-1810027, 'Frostmourne hungers...',null,null,null,null,null,null,null,null,17366,1,0,0,''),
    (-1810028, 'Frostmourne feeds on the soul of your fallen ally!',null,null,null,null,null,null,null,null,17368,1,0,0,''),
    (-1810029, 'Val\'kyr, your master calls!',null,null,null,null,null,null,null,null,17373,1,0,0,''),
    (-1810030, 'Watch as the world around you collapses!',null,null,null,null,null,null,null,null,17370,1,0,0,''),
    (-1810031, 'You gnats actually hurt me! Perhaps I\'ve toyed with you long enough, now taste the vengeance of the grave!',null,null,null,null,null,null,null,null,17359,1,0,0,'');
    this will work?But how do you mean C++ (i mean i know i need to compile it to server)but how to compile to trinity repacks?my version is 3.3.5a

Similar Threads

  1. [Lua Script] Small errors in script layout, need help!
    By B1ng in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 07-24-2010, 05:05 AM
  2. [Lua] Error in script
    By Emanuel095 in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 03-07-2010, 07:26 AM
  3. [Lua] Error in script
    By aseroth in forum WoW EMU Questions & Requests
    Replies: 9
    Last Post: 03-07-2010, 06:10 AM
  4. [Help me] Lua script error? please help.
    By Szharz in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 03-22-2008, 12:20 PM
  5. Scripting Error (link fatal)
    By djkajabaxd in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 02-23-2008, 10:46 AM
All times are GMT -5. The time now is 05:04 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search