User Tag List

Results 1 to 5 of 5

Thread: Summon Ohter Crerature On...

  1. #1
    Enthusiast
    Join Date
    Oct 2015
    Posts
    98
    XP
    1,391
    Level
    10
    Thanks
    19
    Thanked 10 Times in 10 Posts

    Summon Ohter Crerature On...

    Hi,

    I was trying to do a script wich summons a other creature when life is less than 25 seconds, and doesnt have DoT Damage.
    I improved only to the part of less than 25%hp left but i dont know how to proceed with DoT damage calc.



    Code:
    local NPC_ID = 123
    
    
    
    local valor = 0
    
    
    
    local function InvocarGranTiniebla (eventID, delay, pCall, creature, target)
    		
    		
    		
    		while(valor == 0 ) do
    		
    		local x, y, z = creature:GetRelativePoint(math.random()*5, math.random()*math.pi*2)
    		creature:SpawnCreature(870759, x, y, z, 0, 7)
    valor = valor + 1
    	end	
    end
    
    
    local function CheckHealth (eventID, delay, pCall, creature, target)
    	if creature:GetHealthPct() <= 25 then
    		local target = creature:GetAITarget(0, true)
    		target:SendAreaTriggerMessage("Menos de 25%HP!")
    		
    		
    	creature:RegisterEvent(InvocarGranTiniebla, 100, 0)
    
    		
    		
    	end
    end
    
    
    
    local function KetLot_OnCombat (event, creature, target)
    	local target = creature:GetAITarget(0, true)
    	creature:AttackStop()
    	creature:RegisterEvent(CheckHealth, 100, 0)
    
    end
    
    local function KetLot_Died (event, creature, target)
    
    
    	creature:RemoveEvents()
    end
    
    local function KetLot_OnLeaveCombat (event, creature, target)
    	creature:RemoveEvents()
    end
    
    local function KetLot_Spawn (event, creature, target)
    	creature:MoveHome()
    	creature:SetWalk(true)
    end
    
    RegisterCreatureEvent(NPC_ID, 1, KetLot_OnCombat)
    RegisterCreatureEvent(NPC_ID, 24, KetLot_OnLeaveCombat)
    RegisterCreatureEvent(NPC_ID, 5, KetLot_Spawn)
    RegisterCreatureEvent(NPC_ID, 4, KetLot_Died)
    THIS CODE IS BUGGY, IT ONLY SPAWNS FIRST TIME AFTER SERVER RESTART
    Last edited by jonmii; 09-11-2016 at 01:05 PM.
    Achievements:
    Member 1 year registered Level X

  2. #2
    Original Poster
    Enthusiast
    Join Date
    Oct 2015
    Posts
    98
    XP
    1,391
    Level
    10
    Thanks
    19
    Thanked 10 Times in 10 Posts
    Hi ED, someone still alive?

  3. #3
    Mad Scientist <span style='color: #008000'><span class='glow_006400'>slp13at420</span></span>'s Avatar



    Join Date
    Dec 2013
    Location
    Idaho
    Posts
    2,480
    XP
    20,134,655
    Level
    500
    Thanks
    1,086
    Thanked 329 Times in 211 Posts
    wouldn't DoT fall under `Aura` category?
    Code:
    
    local Aura = creature:GetAura(x);
    
    http://eluna.emudevs.com/Unit/GetAura.html


    if so then you could loop thru a table of all the spells that use DoT auras, then you can use
    Code:
    
    local duration_left = Aura:GetDuration();
    
    http://eluna.emudevs.com/Aura/GetDuration.html

    http://eluna.emudevs.com/index.html
    Last edited by slp13at420; 09-15-2016 at 02:31 AM.
    Achievements:
    Shopper Got a Sticky! Member 1 year registered Level XL Level D
    Awards:
    Pot Head LOL Raffle Winner Top Tagger Donator Hangman Scripter Repacker Drunk Support Member of Staff Da Bomb!
    "Cuz PvP's better with a bag 'o' weed"
    !! King Spade !!

    -Guild Plot System-
    Grumbo'z Guild Warz


    -VIP System-
    Grumbo'z VIP System

  4. #4
    Original Poster
    Enthusiast
    Join Date
    Oct 2015
    Posts
    98
    XP
    1,391
    Level
    10
    Thanks
    19
    Thanked 10 Times in 10 Posts
    So using that i have to store all spellsids manually on code.
    My intention was to get any DoT duration, globally.

    Thanks anyway

  5. #5
    Mad Scientist <span style='color: #008000'><span class='glow_006400'>slp13at420</span></span>'s Avatar



    Join Date
    Dec 2013
    Location
    Idaho
    Posts
    2,480
    XP
    20,134,655
    Level
    500
    Thanks
    1,086
    Thanked 329 Times in 211 Posts
    just the ids of spells with Dot I think .. at first ponder yea that is the only way to . I haven't seen an Eluna method like `Creature:GetAuras();` that would return a table of all current auras a player/char/npc has.
    Last edited by slp13at420; 09-18-2016 at 01:33 PM.
    Achievements:
    Shopper Got a Sticky! Member 1 year registered Level XL Level D
    Awards:
    Pot Head LOL Raffle Winner Top Tagger Donator Hangman Scripter Repacker Drunk Support Member of Staff Da Bomb!
    "Cuz PvP's better with a bag 'o' weed"
    !! King Spade !!

    -Guild Plot System-
    Grumbo'z Guild Warz


    -VIP System-
    Grumbo'z VIP System

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •