mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[8774] Implement SCRIPT_COMMAND_KILL_CREDIT (8).
Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
6b1e76a150
commit
adde82b73c
4 changed files with 42 additions and 1 deletions
|
|
@ -2988,6 +2988,36 @@ void Map::ScriptsProcess()
|
|||
break;
|
||||
}
|
||||
|
||||
case SCRIPT_COMMAND_KILL_CREDIT:
|
||||
{
|
||||
// accept player in any one from target/source arg
|
||||
if (!target && !source)
|
||||
{
|
||||
sLog.outError("SCRIPT_COMMAND_KILL_CREDIT call for NULL object.");
|
||||
break;
|
||||
}
|
||||
|
||||
// must be only Player
|
||||
if((!target || target->GetTypeId() != TYPEID_PLAYER) && (!source || source->GetTypeId() != TYPEID_PLAYER))
|
||||
{
|
||||
sLog.outError("SCRIPT_COMMAND_KILL_CREDIT call for non-player (TypeIdSource: %u)(TypeIdTarget: %u), skipping.", source ? source->GetTypeId() : 0, target ? target->GetTypeId() : 0);
|
||||
break;
|
||||
}
|
||||
|
||||
Player* pSource = target && target->GetTypeId() == TYPEID_PLAYER ? (Player*)target : (Player*)source;
|
||||
|
||||
if (step.script->datalong2)
|
||||
{
|
||||
pSource->RewardPlayerAndGroupAtEvent(step.script->datalong, pSource);
|
||||
}
|
||||
else
|
||||
{
|
||||
pSource->KilledMonsterCredit(step.script->datalong, 0);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case SCRIPT_COMMAND_TEMP_SUMMON_CREATURE:
|
||||
{
|
||||
if(!step.script->datalong) // creature not specified
|
||||
|
|
|
|||
|
|
@ -4100,6 +4100,16 @@ void ObjectMgr::LoadScripts(ScriptMapMap& scripts, char const* tablename)
|
|||
break;
|
||||
}
|
||||
|
||||
case SCRIPT_COMMAND_KILL_CREDIT:
|
||||
{
|
||||
if (!GetCreatureTemplate(tmp.datalong))
|
||||
{
|
||||
sLog.outErrorDb("Table `%s` has invalid creature (Entry: %u) in SCRIPT_COMMAND_KILL_CREDIT for script id %u",tablename,tmp.datalong,tmp.id);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case SCRIPT_COMMAND_TEMP_SUMMON_CREATURE:
|
||||
{
|
||||
if(!MaNGOS::IsValidMapCoord(tmp.x,tmp.y,tmp.z,tmp.o))
|
||||
|
|
|
|||
|
|
@ -343,6 +343,7 @@ enum RealmZone
|
|||
#define SCRIPT_COMMAND_FLAG_REMOVE 5 // source = any, datalong = field_id, datalog2 = bitmask
|
||||
#define SCRIPT_COMMAND_TELEPORT_TO 6 // source or target with Player, datalong = map_id, x/y/z
|
||||
#define SCRIPT_COMMAND_QUEST_EXPLORED 7 // one from source or target must be Player, another GO/Creature, datalong=quest_id, datalong2=distance or 0
|
||||
#define SCRIPT_COMMAND_KILL_CREDIT 8 // source or target with Player, datalong = creature entry, datalong2 = bool (0=personal credit, 1=group credit)
|
||||
#define SCRIPT_COMMAND_RESPAWN_GAMEOBJECT 9 // source = any (summoner), datalong=db_guid, datalong2=despawn_delay
|
||||
#define SCRIPT_COMMAND_TEMP_SUMMON_CREATURE 10 // source = any (summoner), datalong=creature entry, datalong2=despawn_delay
|
||||
#define SCRIPT_COMMAND_OPEN_DOOR 11 // source = unit, datalong=db_guid, datalong2=reset_delay
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8773"
|
||||
#define REVISION_NR "8774"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue