Hi, i try to summon gameobject when JustDied event occur, not work, i dnt see why.
void JustDied(Unit* killer)
{
if (killer->GetTypeId()== TYPEID_PLAYER && killer->ToPlayer()->GetQuestStatus(QUEST_ID) == QUEST_STATUS_INCOMPLETE)
{
me->SummonGameObject(GO_HERBAL,me->GetPositionX(),me->GetPositionY(),me->GetPositionZ(),me->GetOrientation(),0.0f,0.0f,0.0f,0.0f,1);
}
}
Anyone can help me ?
Who the fuck is me (the pointer for SummonGameObject) and why is the Unit that just died called “killer” ? The hell. Also, the last parameter 1 is suppose to be added in MILLISECONDS.
Brian
October 24, 2013, 1:46pm
3
Ascathor, I wasn’t going to help him since he didn’t post his whole script.
– Brian
I don’t even need to think about his script working even remotely if he already failed in this little part by copy pasting. So it didn’t matter to me. I see your point though
Subv
October 24, 2013, 3:32pm
5
@Ascathor , you suck, that code was correct except for the milliseconds parameter.
Shatap /emoticons/default_sad.png
The creaturescript source is ‘me’… What the fuck do you mean /emoticons/default_smile.png
And the unit called killer is, in fact, correct. That’s the parameter of the hook.
Dhiana
October 25, 2013, 6:51am
8
Try out this.
void JustDied(Unit* killer) OVERRIDE
{
if(killer->GetTypeId() == TYPEID_PLAYER &&
killer->ToPlayer()->GetQuestStatus(QuestId) == QUEST_STATUS_INCOMPLETE)
if(Player* tPlayer = killer->ToPlayer())
tPlayer->SummonGameObject(ObjeId, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(),
me->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 1);
}
Thanks Dhiana, i go try this.
Respawn is still a millisecond parameter.
Dhiana
October 28, 2013, 7:41am
11
i know, lecais77 has there a 1, so i dont edited the values he added.