EY guys im trying to despawn an object in C++
#include “ScriptPCH.h”
#include “Spell.h”
class npc_item_summon_all : public ItemScript
{
public:
npc_item_summon_all() : ItemScript(“npc_item_summon_all”) { }
bool OnUse(Player* pPlayer, Item* /*pItem*/, SpellCastTargets const& /*targets*/)
{
pPlayer->SummonGameObject(191605, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 0, 60000);
pPlayer->SummonCreature(9999020, pPlayer->GetPositionX()-2, pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 60000);
pPlayer->SummonCreature(9999021, pPlayer->GetPositionX()+2, pPlayer->GetPositionY(), pPlayer->GetPositionZ()+2, 0, TEMPSUMMON_TIMED_DESPAWN, 60000);
return false;
}
};
void AddSC_npc_item_summon()
{
new npc_item_summon_all;
}
there’s my script
now this line :
pPlayer->SummonGameObject(191605, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 0, 60000);
is not working correctly or im doing something wrong. I want to despawn object in 60000 wich is 1 min i guess.