• This is a read only backup of the old Emudevs forum. If you want to have anything removed, please message me on Discord: KittyKaev

Npc loot

Status
Not open for further replies.

uDev

Illustrious Member
Is it possible with eluna to check when you kill npc if it dropped lets say item with id 1337 ?

Im trying to make something like this:
Code:
local npcId = 123
local itemid = 1337

local function WhenDie(event, creature, killer)
    if(killer:GetObjectType() == "Player") then
' here needs check if npc dropped item
		creature:SendUnitSay("I have dropped this item!", 0)
    end
end

RegisterCreatureEvent(npcId, 4, WhenDie)
 

uDev

Illustrious Member
So its not possible to make npc on die to say if it dropped some rare item or not? Not even possible with C++ ?
 

Rochet2

Moderator / Eluna Dev
So its not possible to make npc on die to say if it dropped some rare item or not? Not even possible with C++ ?

Should be possible in C++.
void Unit::Kill(Unit* victim, bool durabilityLoss)
This function calls the loot generating and in there you can somewhere check if a rare item is added and announce it.
 
Status
Not open for further replies.
Top