24template<
typename E,
typename T =
char const*>
31#define CREATE_NAMED_ENUM(VALUE) { VALUE, STRINGIZE(VALUE) }
33#define NPCFLAG_COUNT 29
148 static std::vector<ChatCommand> npcAddCommandTable =
157 static std::vector<ChatCommand> npcDeleteCommandTable =
162 static std::vector<ChatCommand> npcFollowCommandTable =
167 static std::vector<ChatCommand> npcSetCommandTable =
185 static std::vector<ChatCommand> npcCommandTable =
201 static std::vector<ChatCommand> commandTable =
218 char* team = strtok(NULL,
" ");
221 teamval = atoi(team);
247 Creature* creature = trans->CreateNPCPassenger(guid, &data);
286 const uint8 type = 1;
296 int32 item_int = atol(pitem);
302 char* fmaxcount = strtok(NULL,
" ");
305 maxcount = atol(fmaxcount);
307 char* fincrtime = strtok(NULL,
" ");
310 incrtime = atol(fincrtime);
312 char* fextendedcost = strtok(NULL,
" ");
313 uint32 extendedcost = fextendedcost ? atol(fextendedcost) : 0;
330 sObjectMgr->AddVendorItem(vendor_entry, itemId, maxcount, incrtime, extendedcost, type);
344 char* guidStr = strtok((
char*)args,
" ");
345 char* waitStr = strtok((
char*)NULL,
" ");
347 uint32 lowGuid = atoi((
char*)guidStr);
373 int wait = waitStr ? atoi(waitStr) : 0;
405 if (
sWorld->getAllowMovement())
407 sWorld->SetAllowMovement(
false);
412 sWorld->SetAllowMovement(
true);
423 uint32 newEntryNum = atoi(args);
464 if (creature->
IsPet())
471 ((
Pet*)creature)->GivePetLevel(lvl);
495 uint32 lowguid = atoi(cId);
543 uint32 itemId = atol(pitem);
545 const uint8 type = 1;
644 char* arg1 = strtok((
char*)args,
" ");
645 char* arg2 = strtok((
char*)NULL,
"");
653 if (!data_1 || !data_2)
712 if (curRespawnDelay < 0)
751 float distance = (!*args) ? 10.0f : float((atof(args)));
764 stmt->
setFloat(7, distance * distance);
771 Field* fields = result->Fetch();
780 if (!creatureTemplate)
786 }
while (result->NextRow());
885 uint32 emote = atoi((
char*)args);
910 if (!creature || creature->
IsPet())
949 char* guid_str = strtok((
char*)args,
" ");
950 char* type_str = strtok((
char*)NULL,
" ");
951 char* dontdel_str = strtok((
char*)NULL,
" ");
953 bool doNotDelete =
false;
969 if (stricmp(dontdel_str,
"NODEL") == 0)
981 if (stricmp(type_str,
"NODEL") == 0)
994 if (!creature || creature->
IsPet())
1000 lowguid = atoi((
char*)guid_str);
1029 std::string type = type_str;
1033 else if (type ==
"random")
1035 else if (type ==
"way")
1047 if (doNotDelete ==
false)
1059 if (doNotDelete ==
false)
1081 if (!creature || creature->
IsPet())
1110 if (!creature || creature->
IsPet())
1131 float option = (float)(atof((
char*)args));
1177 char* stime = strtok((
char*)args,
" ");
1182 int spawnTime = atoi((
char*)stime);
1228 char lastchar = args[strlen(args) - 1];
1302 char* receiver_str = strtok((
char*)args,
" ");
1303 char* text = strtok(NULL,
"");
1306 if (!creature || !receiver_str || !text)
1309 uint64 receiver_guid = atol(receiver_str);
1353 uint32 id = atoi(charID);
1369 if (!creatureTarget || creatureTarget->
IsPet())
1479 handler->
PSendSysMessage(
"Creature %u added to formation with leader %u", lowguid, leaderGUID);
1509 handler->
PSendSysMessage(
"Selected creature can't link with guid '%u'", linkguid);
std::set< uint32 > const & GetPhasesForGroup(uint32 group)
DBCStorage< FactionTemplateEntry > sFactionTemplateStore(FactionTemplateEntryfmt)
@ LANG_NPCINFO_BMAUCTIONEER
@ LANG_NPCINFO_VENDOR_REAGENT
@ LANG_NPCINFO_VAULTKEEPER
@ LANG_NPCINFO_TRAINER_PROFESSION
@ LANG_CREATURE_NON_TAMEABLE
@ LANG_CREATURE_NOT_FOLLOW_YOU
@ LANG_NPCINFO_QUESTGIVER
@ LANG_CREATURE_FOLLOW_YOU_NOW
@ LANG_NPCINFO_VENDOR_AMMO
@ LANG_YOU_ALREADY_HAVE_PET
@ LANG_NPCINFO_GUILD_BANKER
@ LANG_CREATURE_MOVE_ENABLED
@ LANG_NPCINFO_UNIT_FIELD_FLAGS
@ LANG_VALUE_SAVED_REJOIN
@ LANG_COMMAND_CREATUREMOVED
@ LANG_COMMAND_DELCREATMESSAGE
@ LANG_CREATURE_NOT_FOLLOW_YOU_NOW
@ LANG_NPCINFO_TABARDDESIGNER
@ LANG_COMMAND_CREATUREATSAMEMAP
@ LANG_NPCINFO_FLIGHTMASTER
@ LANG_COMMAND_NEAR_NPC_MESSAGE
Old ones now free:
@ LANG_NPCINFO_SPIRITGUIDE
@ LANG_NPCINFO_TRANSMOGRIFIER
@ LANG_NPCINFO_VENDOR_POISON
@ LANG_COMMAND_NEEDITEMSEND
@ LANG_NPCINFO_TRAINER_CLASS
@ LANG_COMMAND_VENDORSELECTION
@ LANG_CREATURE_MOVE_DISABLED
@ LANG_ITEM_ADDED_TO_LIST
@ LANG_NPCINFO_AUCTIONEER
@ LANG_NPCINFO_VENDOR_FOOD
@ LANG_NPCINFO_PETITIONER
@ LANG_NPCINFO_BATTLEMASTER
@ LANG_NPCINFO_SPELLCLICK
@ LANG_ITEM_DELETED_FROM_LIST
@ LANG_MOVE_TYPE_SET_NODEL
@ LANG_NPCINFO_STABLEMASTER
@ LANG_COMMAND_CREATGUIDNOTFOUND
@ LANG_NPCINFO_PLAYER_VEHICLE
@ LANG_NPCINFO_WILDPET_CAPTURABLE
@ LANG_CREATURE_LIST_CHAT
@ LANG_COMMAND_RAWPAWNTIMES
@ LANG_NPCINFO_SPIRITHEALER
@ LANG_NPCINFO_DUNGEON_ID
@ LANG_NPCINFO_MECHANIC_IMMUNE
#define SF_LOG_ERROR(filterType__,...)
@ TEMPSUMMON_CORPSE_DESPAWN
uint64 MAKE_NEW_GUID(uint32 l, uint32 e, uint32 h)
Skyfire::AutoPtr< PreparedResultSet, Skyfire::Mutex > PreparedQueryResult
@ EMOTE_ONESHOT_EXCLAMATION
@ MECHANIC_INVULNERABILITY
@ UNIT_NPC_FLAG_WILDPET_CAPTURABLE
@ UNIT_NPC_FLAG_VENDOR_AMMO
@ UNIT_NPC_FLAG_TABARDDESIGNER
@ UNIT_NPC_FLAG_AUCTIONEER
@ UNIT_NPC_FLAG_VENDOR_POISON
@ UNIT_NPC_FLAG_GUILD_BANKER
@ UNIT_NPC_FLAG_STABLEMASTER
@ UNIT_NPC_FLAG_VENDOR_REAGENT
@ UNIT_NPC_FLAG_BATTLEMASTER
@ UNIT_NPC_FLAG_VENDOR_FOOD
@ UNIT_NPC_FLAG_QUESTGIVER
@ UNIT_NPC_FLAG_INNKEEPER
@ UNIT_NPC_FLAG_SPELLCLICK
@ UNIT_NPC_FLAG_TRANSMOGRIFIER
@ UNIT_NPC_FLAG_PLAYER_VEHICLE
@ UNIT_NPC_FLAG_FLIGHTMASTER
@ UNIT_NPC_FLAG_TRAINER_CLASS
@ UNIT_NPC_FLAG_VAULTKEEPER
@ UNIT_NPC_FLAG_TRAINER_PROFESSION
@ UNIT_NPC_FLAG_PETITIONER
@ UNIT_NPC_FLAG_SPIRITGUIDE
@ UNIT_NPC_FLAG_SPIRITHEALER
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_IMMUNE_TO_NPC
@ UNIT_FLAG_DISABLE_POWERS
@ UNIT_FLAG_SERVER_CONTROLLED
@ UNIT_FLAG_PVP_ATTACKABLE
@ UNIT_FLAG_NOT_SELECTABLE
@ UNIT_FLAG_NOT_ATTACKABLE_1
@ UNIT_FLAG_PLAYER_CONTROLLED
@ UNIT_FLAG_PET_IN_COMBAT
@ UNIT_FIELD_PET_EXPERIENCE
@ UNIT_FIELD_PET_NEXT_LEVEL_EXPERIENCE
@ UNIT_FIELD_NPC_EMOTESTATE
@ OBJECT_FIELD_DYNAMIC_FLAGS
std::string secsToTimeString(uint64 timeInSecs, bool shortText, bool hoursOnly)
@ WORLD_UPD_CREATURE_POSITION
@ WORLD_UPD_CREATURE_NPCFLAG
@ WORLD_SEL_CREATURE_NEAREST
@ WORLD_INS_CREATURE_FORMATION
@ WORLD_UPD_CREATURE_MOVEMENT_TYPE
@ WORLD_UPD_CREATURE_SPAWN_TIME_SECS
@ WORLD_UPD_CREATURE_SPAWN_DISTANCE
@ WORLD_UPD_CREATURE_FACTION
bool HasLowerSecurity(Player *target, uint64 guid, bool strong=false)
WorldSession * GetSession()
Creature * getSelectedCreature()
char * extractKeyFromLink(char *text, char const *linkType, char **something1=NULL)
void PSendSysMessage(const char *format,...) ATTR_PRINTF(2
void SetSentErrorMessage(bool val)
virtual void SendSysMessage(const char *str)
CommandScript(const char *name)
int8 GetOriginalEquipmentId() const
void Respawn(bool force=false)
void SetRespawnRadius(float dist)
uint32 GetDBTableGUIDLow() const
bool UpdateEntry(uint32 entry, uint32 team=ALLIANCE, const CreatureData *data=NULL)
virtual void DeleteFromDB()
uint32 GetWaypointPath() const
void SetDisplayId(uint32 modelId) OVERRIDE
void SetReactState(ReactStates st)
void SetRespawnDelay(uint32 delay)
void SetPosition(float x, float y, float z, float o)
CreatureTemplate const * GetCreatureTemplate() const
uint32 GetRespawnDelay() const
std::string GetAIName() const
CreatureGroup * GetFormation()
std::string GetScriptName() const
bool Create(uint32 guidlow, Map *map, uint32 Entry, uint32 vehId, uint32 team, float x, float y, float z, float ang, const CreatureData *data=NULL)
uint8 GetCurrentEquipmentId() const
bool LoadCreatureFromDB(uint32 guid, Map *map, bool addToMap=true)
void setDeathState(DeathState s) OVERRIDE
time_t GetRespawnTimeEx() const
void SetDefaultMovementType(MovementGeneratorType mgt)
void LoadPath(uint32 pathid)
uint8 GetSpawnMode() const
Creature * GetCreature(uint64 guid)
MovementGeneratorType GetCurrentMovementGeneratorType() const
void MoveFollow(Unit *target, float dist, float angle, MovementSlot slot=MOTION_SLOT_ACTIVE)
void MovementExpired(bool reset=true)
static Player * FindPlayer(uint64)
uint32 GetUInt32Value(uint16 index) const
uint32 GetGUIDLow() const
void SetUInt32Value(uint16 index, uint32 value)
void SavePetToDB(PetSaveMode mode)
bool CanTameExoticPets() const
void PetSpellInitialize()
void setFloat(const uint8 index, const float value)
void setUInt16(const uint8 index, const uint16 value)
void setUInt32(const uint8 index, const uint32 value)
void setUInt8(const uint8 index, const uint8 value)
virtual void SetData(uint32, uint32)
void SetMinion(Minion *minion, bool apply)
void setFaction(uint32 faction)
void CombatStop(bool includingCast=false)
void ClearPhases(bool update=false)
void UpdateObjectVisibility(bool forced=true) override
uint32 getFaction() const
bool SetPhased(uint32 id, bool update, bool apply) OVERRIDE
Pet * CreateTamedPetFrom(Creature *creatureTarget, uint32 spell_id=0)
MotionMaster * GetMotionMaster()
uint64 GetPetGUID() const
uint32 GetMaxHealth() const
void SetHealth(uint32 val)
uint32 GetDisplayId() const
uint32 GetNativeDisplayId() const
uint32 GetCreateHealth() const
void SetNativeDisplayId(uint32 modelId)
virtual float GetFollowAngle() const
void HandleEmoteCommand(uint32 anim_id)
void SetMaxHealth(uint32 val)
uint32 GetPhaseMask() const
std::set< uint32 > const & GetPhases() const
float GetTransOffsetX() const
uint32 GetInstanceId() const
float GetTransOffsetY() const
std::string const & GetName() const
float GetTransOffsetZ() const
void AddObjectToRemoveList()
Transport * GetTransport() const
void MonsterWhisper(const char *text, Player const *target, bool IsBossWhisper=false)
void MonsterSay(const char *text, Language language, WorldObject const *target)
void MonsterTextEmote(const char *text, WorldObject const *target, bool IsBossEmote=false)
void GetClosePoint(float &x, float &y, float &z, float size, float distance2d=0, float angle=0) const
void MonsterYell(const char *text, Language language, WorldObject const *target)
float GetTransOffsetO() const
float GetObjectSize() const
TempSummon * SummonCreature(uint32 id, Position const &pos, TempSummonType spwtype=TempSummonType::TEMPSUMMON_MANUAL_DESPAWN, uint32 despwtime=0, uint32 vehId=0) const
Player * GetPlayer() const
static bool HandleNpcTextEmoteCommand(ChatHandler *handler, char const *args)
static bool HandleNpcNearCommand(ChatHandler *handler, char const *args)
static bool HandleNpcAddFormationCommand(ChatHandler *handler, char const *args)
static bool HandleNpcAddMoveCommand(ChatHandler *handler, char const *args)
static bool HandleNpcSetFactionIdCommand(ChatHandler *handler, char const *args)
static bool HandleNpcSetSpawnTimeCommand(ChatHandler *handler, char const *args)
static bool HandleNpcAddCommand(ChatHandler *handler, char const *args)
std::vector< ChatCommand > GetCommands() const OVERRIDE
static bool HandleNpcSetSubNameCommand(ChatHandler *, char const *)
static bool HandleNpcWhisperCommand(ChatHandler *handler, char const *args)
static bool HandleNpcSetLinkCommand(ChatHandler *handler, char const *args)
static bool HandleNpcTameCommand(ChatHandler *handler, char const *)
static bool HandleNpcSetMoveTypeCommand(ChatHandler *handler, char const *args)
static bool HandleNpcSetPhaseCommand(ChatHandler *handler, char const *args)
static bool HandleNpcFollowCommand(ChatHandler *handler, char const *)
static bool HandleNpcAddVendorItemCommand(ChatHandler *handler, char const *args)
static bool HandleNpcSetLevelCommand(ChatHandler *handler, char const *args)
static bool HandleNpcSetEntryCommand(ChatHandler *handler, char const *args)
static bool HandleNpcInfoCommand(ChatHandler *handler, char const *)
static bool HandleNpcSetDataCommand(ChatHandler *handler, char const *args)
static bool HandleNpcYellCommand(ChatHandler *handler, char const *args)
static bool HandleNpcMoveCommand(ChatHandler *handler, char const *args)
static bool HandleNpcSetNameCommand(ChatHandler *, char const *)
static bool HandleNpcSetSpawnDistCommand(ChatHandler *handler, char const *args)
static bool HandleNpcSetModelCommand(ChatHandler *handler, char const *args)
static bool HandleNpcAddWeaponCommand(ChatHandler *, char const *)
static bool HandleNpcUnFollowCommand(ChatHandler *handler, char const *)
static bool HandleNpcSetPhaseGroup(ChatHandler *handler, char const *args)
static bool HandleNpcAddTempSpawnCommand(ChatHandler *handler, char const *args)
static bool HandleNpcSetAllowMovementCommand(ChatHandler *handler, char const *)
static bool HandleNpcSetFlagCommand(ChatHandler *handler, char const *args)
static bool HandleNpcPlayEmoteCommand(ChatHandler *handler, char const *args)
static bool HandleNpcSayCommand(ChatHandler *handler, char const *args)
static bool HandleNpcDeleteCommand(ChatHandler *handler, char const *args)
static bool HandleNpcDeleteVendorItemCommand(ChatHandler *handler, char const *args)
EnumName< NPCFlags, int32 > const npcFlagTexts[NPCFLAG_COUNT]
EnumName< UnitFlags > const unitFlags[MAX_UNIT_FLAGS]
#define CREATE_NAMED_ENUM(VALUE)
void AddSC_npc_commandscript()
EnumName< Mechanics > const mechanicImmunes[MAX_MECHANIC]
WorldDatabaseWorkerPool WorldDatabase
Accessor to the world database.
@ CONFIG_MAX_PLAYER_LEVEL
@ RBAC_PERM_COMMAND_NPC_SET_LEVEL
@ RBAC_PERM_COMMAND_NPC_PLAYEMOTE
@ RBAC_PERM_COMMAND_NPC_FOLLOW
@ RBAC_PERM_COMMAND_NPC_INFO
@ RBAC_PERM_COMMAND_NPC_TEXTEMOTE
@ RBAC_PERM_COMMAND_NPC_ADD_FORMATION
@ RBAC_PERM_COMMAND_NPC_ADD
@ RBAC_PERM_COMMAND_NPC_SET
@ RBAC_PERM_COMMAND_NPC_NEAR
@ RBAC_PERM_COMMAND_NPC_SET_SPAWNDIST
@ RBAC_PERM_COMMAND_NPC_SET_PHASE
@ RBAC_PERM_COMMAND_NPC_DELETE
@ RBAC_PERM_COMMAND_NPC_SET_ENTRY
@ RBAC_PERM_COMMAND_NPC_TAME
@ RBAC_PERM_COMMAND_NPC_MOVE
@ RBAC_PERM_COMMAND_NPC_ADD_ITEM
@ RBAC_PERM_COMMAND_NPC_SET_SPAWNTIME
@ RBAC_PERM_COMMAND_NPC_SET_FACTIONID
@ RBAC_PERM_COMMAND_NPC_SET_MOVETYPE
@ RBAC_PERM_COMMAND_NPC_SET_DATA
@ RBAC_PERM_COMMAND_NPC_SET_ALLOWMOVE
@ RBAC_PERM_COMMAND_NPC_SET_MODEL
@ RBAC_PERM_COMMAND_NPC_ADD_MOVE
@ RBAC_PERM_COMMAND_NPC_SET_LINK
@ RBAC_PERM_COMMAND_NPC_FOLLOW_STOP
@ RBAC_PERM_COMMAND_NPC_WHISPER
@ RBAC_PERM_COMMAND_NPC_SET_FLAG
@ RBAC_PERM_COMMAND_NPC_YELL
@ RBAC_PERM_COMMAND_NPC_SAY
@ RBAC_PERM_COMMAND_NPC_ADD_TEMP
@ RBAC_PERM_COMMAND_NPC_DELETE_ITEM
uint32 MechanicImmuneMask
bool IsTameable(bool canTameExotic) const
float GetAngle(Position const *pos) const
float GetPositionZ() const
float GetOrientation() const
float GetPositionX() const
float GetPositionY() const
void Relocate(float x, float y)