need  help with boss script menu

Shout-Out

User Tag List

Results 1 to 7 of 7
  1. #1
    bellios's Avatar Private
    Reputation
    1
    Join Date
    Dec 2010
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need help with boss script

    Code:
    local NAME = "Naga2"
    local NPCID = 100043
    
    function Naga2_OnCombat(pUnit, event, player)
    pUnit:SendChatMessage(14, 0, "What's this?! DIE MORTALS!!")
    end
    
    function Naga2_OnLeaveCombat(pUnit, event, player)
    pUnit:SendChatMessage(14, 0, "HAHA RUN COWARDS!!")
    pUnit:RemoveEvents()
    end
    
    function Naga2_OnKilledTarget(pUnit, event, player)
    pUnit:SendChatMessage(14, 0, "Now that i killed you, I shall use your skull as a bowl for my Lucky Charms!")
    pUnit:RemoveEvents()
    end
    
    function Naga2_OnDeath(pUnit, event, player)
    pUnit:SendChatMessage(14, 0, "ARRGGHH THIS CAN'T BE!!!")
    pUnit:GetTarget()
    pUnit:AddItem(1908, 1)
    pUnit:RemoveEvents()
    end
    
    RegisterUnitEvent(100043, 1, "Naga2_OnCombat")
    RegisterUnitEvent(100043, 2, "Naga2_OnLeaveCombat")
    RegisterUnitEvent(100043, 3, "Naga2_OnKilledTarget")
    RegisterUnitEvent(100043, 4, "Naga2_OnDeath")
    ive been using lua 1 day now. this is a short, simple mini boss fight. boss is good, but wont drop loot, just get gold. ive used heidisql to manually add it to the database, but when i hit the check mark, and error message pops up saying theres a duplicate... i havent used that though, so i figured id fix it by finding it and changing it, didnt work. so i deleted that mob, since it was a little lvl 39, and my realm is inst 80. still getting error... so i need scripts for it, but i need help

    need  help with boss script
  2. #2
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Code:
    -- We don't define Naga2
    local NPCID = 100043
    
    function Naga2_OnCombat(pUnit, event)
         pUnit:SendChatMessage(14, 0, "What's this?! DIE MORTALS!!")
    end
    
    function Naga2_OnLeaveCombat(pUnit, event)
        pUnit:SendChatMessage(14, 0, "HAHA RUN COWARDS!!")
        -- There are no events to remove yet, removing events are stopping registered events with what does it, e.g: pUnit:RegisterEvent
    end
    
    function Naga2_OnKilledTarget(pUnit, event)
        pUnit:SendChatMessage(14, 0, "Now that i killed you, I shall use your skull as a bowl for my Lucky Charms!")
    end
    
    function Naga2_OnDeath(pUnit, event)
        pUnit:SendChatMessage(14, 0, "ARRGGHH THIS CAN'T BE!!!")
        --pUnit:GetTarget() -- We need to define this, but easier to do the following:
        pUnit:GetClosestPlayer():AddItem(1908,1)
        -- Alternatively, pUnit:GetMainTank():AddItem(1908,1) -- Although I'm not sure if it looses the main target on death
        --
        -- Could be done similarly using variables:
        -- local player = pUnit:GetClosestPlayer()
        -- player:AddItem(1908,1)
        --
        --pUnit:AddItem(1908, 1) -- Were not adding the item to the unit
        -- No events to remove, see above
    end
    
    RegisterUnitEvent(100043, 1, "Naga2_OnCombat")
    RegisterUnitEvent(100043, 2, "Naga2_OnLeaveCombat")
    RegisterUnitEvent(100043, 3, "Naga2_OnKilledTarget")
    RegisterUnitEvent(100043, 4, "Naga2_OnDeath")
    A -- = a comment. Get notepad++ if you haven't already, it helps so much when scripting.

    I fixed up your script to get it to work how you want it to, but it's a really bad way to do it.

    With your SQL, your getting a duplicate because a mob with that loot ID already exists in the database. Do:

    SELECT * FROM `loot_creatures` WHERE `entry` = '999';
    ^
    For example, change to correct values. Edit it to the correct details, or:

    Change INSERT to REPLACE when executing your original query, so now it will look like:

    REPLACE INTO `loot_creatures` VALUES (x,x,x,x,x,x,x);

  3. #3
    bellios's Avatar Private
    Reputation
    1
    Join Date
    Dec 2010
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks so much, worked perfectly

    ---------- Post added at 07:26 AM ---------- Previous post was at 07:20 AM ----------

    actually, when i kill it, it automatically gives me the wep, without even looting. i understand why cause its player:additem, but how do i get it to show in a loot window, and not give it to me automatically?

  4. #4
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by bellios View Post
    thanks so much, worked perfectly

    ---------- Post added at 07:26 AM ---------- Previous post was at 07:20 AM ----------

    actually, when i kill it, it automatically gives me the wep, without even looting. i understand why cause its player:additem, but how do i get it to show in a loot window, and not give it to me automatically?
    It can't be done via Lua.

    There is a table called 'loot_creatures'. This is where loot on death is handled.

  5. #5
    bellios's Avatar Private
    Reputation
    1
    Join Date
    Dec 2010
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ahh alright. i did what you said to do in my database, but still getting that stupid error message for some reason. you have any idea on how i can fix it? and also, i forgot to mention this, but its not abvout bosses or scripts, but about cusomt building. i created a few houses in the mountains in wetlands. if i fly away and back, its not there anymore. like... i should be able to see it, but its just not even there anymore. happened 3 times, at different places, i put a 1 after the go entry id tho. and my cusomt stair events are still there tho... i dont get it

  6. #6
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by bellios View Post
    ahh alright. i did what you said to do in my database, but still getting that stupid error message for some reason. you have any idea on how i can fix it? and also, i forgot to mention this, but its not abvout bosses or scripts, but about cusomt building. i created a few houses in the mountains in wetlands. if i fly away and back, its not there anymore. like... i should be able to see it, but its just not even there anymore. happened 3 times, at different places, i put a 1 after the go entry id tho. and my cusomt stair events are still there tho... i dont get it
    Putting a 1 after the ID should get it to work,

    .go spawn x 1

    If that doesn't work then I'm not sure.

    What is the exact error you are getting when trying to add to loot_creatures?

  7. #7
    bellios's Avatar Private
    Reputation
    1
    Join Date
    Dec 2010
    Posts
    9
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SQL Error (1602): Duplicate entry '4294967295' for key 2

    whenever i try adding loot to a mob in loot_creature, i hit the check and that messafge pops up..thanks again for all the help btw

Similar Threads

  1. [Lua Script] Need help with Boss Script
    By modmassacre in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 03-04-2014, 10:55 PM
  2. [Lua Script] Need help with 2 Scripts (One Boss, One Gauntlet)
    By controlsx2 in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 07-22-2010, 02:42 AM
  3. Help With Boss Script
    By DragenFear in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 10-10-2008, 11:24 PM
  4. Need help with my script [lua]
    By Satzen in forum World of Warcraft Emulator Servers
    Replies: 5
    Last Post: 05-18-2008, 05:19 PM
  5. [C++]Need help with my Scripted Item
    By freezer1012 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 01-13-2008, 05:55 PM
All times are GMT -5. The time now is 02:20 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search