mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[9869] Extend SCRIPT_COMMAND_QUEST_EXPLORED to allow player<->player as source/target
Additional code cleanup and output script id in error messages. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
c5008073f3
commit
d02313d94c
2 changed files with 14 additions and 15 deletions
|
|
@ -3210,15 +3210,15 @@ void Map::ScriptsProcess()
|
||||||
}
|
}
|
||||||
case SCRIPT_COMMAND_QUEST_EXPLORED:
|
case SCRIPT_COMMAND_QUEST_EXPLORED:
|
||||||
{
|
{
|
||||||
if(!source)
|
if (!source)
|
||||||
{
|
{
|
||||||
sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED call for NULL source.");
|
sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED (script id %u) call for NULL source.", step.script->id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!target)
|
if (!target)
|
||||||
{
|
{
|
||||||
sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED call for NULL target.");
|
sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED (script id %u) call for NULL target.", step.script->id);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3226,11 +3226,11 @@ void Map::ScriptsProcess()
|
||||||
WorldObject* worldObject;
|
WorldObject* worldObject;
|
||||||
Player* player;
|
Player* player;
|
||||||
|
|
||||||
if(target->GetTypeId()==TYPEID_PLAYER)
|
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
if(source->GetTypeId()!=TYPEID_UNIT && source->GetTypeId()!=TYPEID_GAMEOBJECT)
|
if (source->GetTypeId() != TYPEID_UNIT && source->GetTypeId() != TYPEID_GAMEOBJECT && source->GetTypeId() != TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED call for non-creature and non-gameobject (TypeId: %u), skipping.",source->GetTypeId());
|
sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED (script id %u) call for non-creature, non-gameobject or non-player (TypeId: %u), skipping.", step.script->id, source->GetTypeId());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3239,15 +3239,15 @@ void Map::ScriptsProcess()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(target->GetTypeId()!=TYPEID_UNIT && target->GetTypeId()!=TYPEID_GAMEOBJECT)
|
if (target->GetTypeId() != TYPEID_UNIT && target->GetTypeId() != TYPEID_GAMEOBJECT && target->GetTypeId() != TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED call for non-creature and non-gameobject (TypeId: %u), skipping.",target->GetTypeId());
|
sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED (script id %u) call for non-creature, non-gameobject or non-player (TypeId: %u), skipping.", step.script->id, target->GetTypeId());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(source->GetTypeId()!=TYPEID_PLAYER)
|
if (source->GetTypeId() != TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED call for non-player(TypeId: %u), skipping.",source->GetTypeId());
|
sLog.outError("SCRIPT_COMMAND_QUEST_EXPLORED (script id %u) call for non-player (TypeId: %u), skipping.", step.script->id, source->GetTypeId());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3256,15 +3256,14 @@ void Map::ScriptsProcess()
|
||||||
}
|
}
|
||||||
|
|
||||||
// quest id and flags checked at script loading
|
// quest id and flags checked at script loading
|
||||||
if( (worldObject->GetTypeId()!=TYPEID_UNIT || ((Unit*)worldObject)->isAlive()) &&
|
if ((worldObject->GetTypeId() != TYPEID_UNIT || ((Unit*)worldObject)->isAlive()) &&
|
||||||
(step.script->datalong2==0 || worldObject->IsWithinDistInMap(player,float(step.script->datalong2))) )
|
(step.script->datalong2 == 0 || worldObject->IsWithinDistInMap(player, float(step.script->datalong2))))
|
||||||
player->AreaExploredOrEventHappens(step.script->datalong);
|
player->AreaExploredOrEventHappens(step.script->datalong);
|
||||||
else
|
else
|
||||||
player->FailQuest(step.script->datalong);
|
player->FailQuest(step.script->datalong);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SCRIPT_COMMAND_ACTIVATE_OBJECT:
|
case SCRIPT_COMMAND_ACTIVATE_OBJECT:
|
||||||
{
|
{
|
||||||
if(!source)
|
if(!source)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "9868"
|
#define REVISION_NR "9869"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue