- Mesaj
- 309
- Çözümler
- 7
- Beğeni
- 179
- Puan
- 749
- Ticaret Puanı
- 0
Hello guys
I was trying to create a code that wakes the player up without a waiting time.
A clearer explanation
When the player wears ring number 71136, the waiting time responsible for the character's resurrection from death will be ignored, so that resurrection is instantaneous instead of waiting 9 seconds. The time condition is removed when the player wears ring number 71136. I tried everything: filling health works, the character's appearance works, and everything else works, but here's an error: the character's position doesn't work. He remains dead on the ground. I can't move, even though I added the condition responsible for the character's position. I don't know if I should add the code somewhere else or where to specify it. I wrote the code and added it inside the ACMD(do_restart) function. Is this the correct place, or should it be somewhere else? I hope someone will look at the code and try to help. Thank you.
I was trying to create a code that wakes the player up without a waiting time.
A clearer explanation
When the player wears ring number 71136, the waiting time responsible for the character's resurrection from death will be ignored, so that resurrection is instantaneous instead of waiting 9 seconds. The time condition is removed when the player wears ring number 71136. I tried everything: filling health works, the character's appearance works, and everything else works, but here's an error: the character's position doesn't work. He remains dead on the ground. I can't move, even though I added the condition responsible for the character's position. I don't know if I should add the code somewhere else or where to specify it. I wrote the code and added it inside the ACMD(do_restart) function. Is this the correct place, or should it be somewhere else? I hope someone will look at the code and try to help. Thank you.
C++:
LPITEM pUniqueItem = ch->GetWear(WEAR_UNIQUE1);
if (pUniqueItem && pUniqueItem->GetVnum() == 71136)
{
if (ch->m_pkDeadEvent)
{
event_cancel(&ch->m_pkDeadEvent);
ch->m_pkDeadEvent = NULL;
}
ch->SetPosition(POS_STANDING);
ch->PointChange(POINT_HP, ch->GetMaxHP());
ch->PointChange(POINT_SP, ch->GetMaxSP());
ch->ReviveInvisible(5);
ch->StartRecoveryEvent();
ch->ChatPacket(CHAT_TYPE_COMMAND, "CloseRestartWindow");
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("The character was instantly revived by the special ring!"));
return;
}