Hi all, with this code the players who are near of respawn zone of a monster will get a message when the monster respawn.
image:
go monster.cpp
find:
[cpp] if(creature == this)
{[/cpp]
add after:
[cpp] if(!isSummon())
{
SpectatorVec list;
g_game.getSpectators(list, getPosition(), false, false, Map::maxViewportX, Map::maxViewportX,
Map::maxViewportY, Map::maxViewportY);
std::stringstream ss;
ss << getName() << " has respawned.";
Player* player = NULL;
for(SpectatorVec::const_iterator it = list.begin(); it != list.end(); ++it)
{
if((player = (*it)->getPlayer()))
player->sendTextMessage(MSG_EVENT_ADVANCE, ss.str());
}
}[/cpp]
that's all
I hope you like this small feature
Regards
image:
go monster.cpp
find:
[cpp] if(creature == this)
{[/cpp]
add after:
[cpp] if(!isSummon())
{
SpectatorVec list;
g_game.getSpectators(list, getPosition(), false, false, Map::maxViewportX, Map::maxViewportX,
Map::maxViewportY, Map::maxViewportY);
std::stringstream ss;
ss << getName() << " has respawned.";
Player* player = NULL;
for(SpectatorVec::const_iterator it = list.begin(); it != list.end(); ++it)
{
if((player = (*it)->getPlayer()))
player->sendTextMessage(MSG_EVENT_ADVANCE, ss.str());
}
}[/cpp]
that's all
I hope you like this small feature
Regards
Last edited: