mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-21 22:41:29 +00:00
NPC constructor converted to use xyz_heading
This commit is contained in:
parent
0570722b3b
commit
54bc1b06e4
47
zone/aa.cpp
47
zone/aa.cpp
@ -319,10 +319,10 @@ void Client::ActivateAA(aaID activate){
|
|||||||
}
|
}
|
||||||
// Check if AA is expendable
|
// Check if AA is expendable
|
||||||
if (aas_send[activate - activate_val]->special_category == 7) {
|
if (aas_send[activate - activate_val]->special_category == 7) {
|
||||||
|
|
||||||
// Add the AA cost to the extended profile to track overall total
|
// Add the AA cost to the extended profile to track overall total
|
||||||
m_epp.expended_aa += aas_send[activate]->cost;
|
m_epp.expended_aa += aas_send[activate]->cost;
|
||||||
|
|
||||||
SetAA(activate, 0);
|
SetAA(activate, 0);
|
||||||
|
|
||||||
SaveAA(); /* Save Character AA */
|
SaveAA(); /* Save Character AA */
|
||||||
@ -598,12 +598,12 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
|
|||||||
if(summon_count > MAX_SWARM_PETS)
|
if(summon_count > MAX_SWARM_PETS)
|
||||||
summon_count = MAX_SWARM_PETS;
|
summon_count = MAX_SWARM_PETS;
|
||||||
|
|
||||||
static const float swarm_pet_x[MAX_SWARM_PETS] = { 5, -5, 5, -5,
|
static const xy_location swarmPetLocations[MAX_SWARM_PETS] = {
|
||||||
10, -10, 10, -10,
|
{5, 5}, {-5, 5}, {5, -5}, {-5, -5},
|
||||||
8, -8, 8, -8 };
|
{10, 10}, {-10, 10}, {10, -10}, {-10, -10},
|
||||||
static const float swarm_pet_y[MAX_SWARM_PETS] = { 5, 5, -5, -5,
|
{8, 8}, {-8, 8}, {8, -8}, {-8, -8}
|
||||||
10, 10, -10, -10,
|
};
|
||||||
8, 8, -8, -8 };
|
|
||||||
while(summon_count > 0) {
|
while(summon_count > 0) {
|
||||||
int pet_duration = pet.duration;
|
int pet_duration = pet.duration;
|
||||||
if(duration_override > 0)
|
if(duration_override > 0)
|
||||||
@ -620,8 +620,8 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u
|
|||||||
NPC* npca = new NPC(
|
NPC* npca = new NPC(
|
||||||
(npc_dup!=nullptr)?npc_dup:npc_type, //make sure we give the NPC the correct data pointer
|
(npc_dup!=nullptr)?npc_dup:npc_type, //make sure we give the NPC the correct data pointer
|
||||||
0,
|
0,
|
||||||
GetX()+swarm_pet_x[summon_count], GetY()+swarm_pet_y[summon_count],
|
GetPosition() + swarmPetLocations[summon_count],
|
||||||
GetZ(), GetHeading(), FlyMode3);
|
FlyMode3);
|
||||||
|
|
||||||
if (followme)
|
if (followme)
|
||||||
npca->SetFollowID(GetID());
|
npca->SetFollowID(GetID());
|
||||||
@ -692,12 +692,11 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid
|
|||||||
if(summon_count > MAX_SWARM_PETS)
|
if(summon_count > MAX_SWARM_PETS)
|
||||||
summon_count = MAX_SWARM_PETS;
|
summon_count = MAX_SWARM_PETS;
|
||||||
|
|
||||||
static const float swarm_pet_x[MAX_SWARM_PETS] = { 5, -5, 5, -5,
|
static const xy_location swarmPetLocations[MAX_SWARM_PETS] = {
|
||||||
10, -10, 10, -10,
|
{5, 5}, {-5, 5}, {5, -5}, {-5, -5},
|
||||||
8, -8, 8, -8 };
|
{10, 10}, {-10, 10}, {10, -10}, {-10, -10},
|
||||||
static const float swarm_pet_y[MAX_SWARM_PETS] = { 5, 5, -5, -5,
|
{8, 8}, {-8, 8}, {8, -8}, {-8, -8}
|
||||||
10, 10, -10, -10,
|
};
|
||||||
8, 8, -8, -8 };
|
|
||||||
|
|
||||||
while(summon_count > 0) {
|
while(summon_count > 0) {
|
||||||
int pet_duration = pet.duration;
|
int pet_duration = pet.duration;
|
||||||
@ -715,8 +714,8 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid
|
|||||||
NPC* npca = new NPC(
|
NPC* npca = new NPC(
|
||||||
(npc_dup!=nullptr)?npc_dup:npc_type, //make sure we give the NPC the correct data pointer
|
(npc_dup!=nullptr)?npc_dup:npc_type, //make sure we give the NPC the correct data pointer
|
||||||
0,
|
0,
|
||||||
GetX()+swarm_pet_x[summon_count], GetY()+swarm_pet_y[summon_count],
|
GetPosition()+swarmPetLocations[summon_count],
|
||||||
GetZ(), GetHeading(), FlyMode3);
|
FlyMode3);
|
||||||
|
|
||||||
if (followme)
|
if (followme)
|
||||||
npca->SetFollowID(GetID());
|
npca->SetFollowID(GetID());
|
||||||
@ -899,7 +898,7 @@ void Mob::WakeTheDead(uint16 spell_id, Mob *target, uint32 duration)
|
|||||||
make_npc->d_meele_texture1 = 0;
|
make_npc->d_meele_texture1 = 0;
|
||||||
make_npc->d_meele_texture2 = 0;
|
make_npc->d_meele_texture2 = 0;
|
||||||
|
|
||||||
NPC* npca = new NPC(make_npc, 0, GetX(), GetY(), GetZ(), GetHeading(), FlyMode3);
|
NPC* npca = new NPC(make_npc, 0, GetPosition(), FlyMode3);
|
||||||
|
|
||||||
if(!npca->GetSwarmInfo()){
|
if(!npca->GetSwarmInfo()){
|
||||||
AA_SwarmPetInfo* nSI = new AA_SwarmPetInfo;
|
AA_SwarmPetInfo* nSI = new AA_SwarmPetInfo;
|
||||||
@ -1056,7 +1055,7 @@ void Client::BuyAA(AA_Action* action)
|
|||||||
/* Do Player Profile rank calculations and set player profile */
|
/* Do Player Profile rank calculations and set player profile */
|
||||||
SaveAA();
|
SaveAA();
|
||||||
/* Save to Database to avoid having to write the whole AA array to the profile, only write changes*/
|
/* Save to Database to avoid having to write the whole AA array to the profile, only write changes*/
|
||||||
// database.SaveCharacterAA(this->CharacterID(), aa2->id, (cur_level + 1));
|
// database.SaveCharacterAA(this->CharacterID(), aa2->id, (cur_level + 1));
|
||||||
|
|
||||||
if ((RuleB(AA, Stacking) && (GetClientVersionBit() >= 4) && (aa2->hotkey_sid == 4294967295u))
|
if ((RuleB(AA, Stacking) && (GetClientVersionBit() >= 4) && (aa2->hotkey_sid == 4294967295u))
|
||||||
&& ((aa2->max_level == (cur_level + 1)) && aa2->sof_next_id)){
|
&& ((aa2->max_level == (cur_level + 1)) && aa2->sof_next_id)){
|
||||||
@ -1077,7 +1076,7 @@ void Client::BuyAA(AA_Action* action)
|
|||||||
if (cur_level < 1){
|
if (cur_level < 1){
|
||||||
Message(15, "You have gained the ability \"%s\" at a cost of %d ability %s.", aa2->name, real_cost, (real_cost>1) ? "points" : "point");
|
Message(15, "You have gained the ability \"%s\" at a cost of %d ability %s.", aa2->name, real_cost, (real_cost>1) ? "points" : "point");
|
||||||
|
|
||||||
/* QS: Player_Log_AA_Purchases */
|
/* QS: Player_Log_AA_Purchases */
|
||||||
if (RuleB(QueryServ, PlayerLogAAPurchases)){
|
if (RuleB(QueryServ, PlayerLogAAPurchases)){
|
||||||
std::string event_desc = StringFormat("Initial AA Purchase :: aa_name:%s aa_id:%i at cost:%i in zoneid:%i instid:%i", aa2->name, aa2->id, real_cost, this->GetZoneID(), this->GetInstanceID());
|
std::string event_desc = StringFormat("Initial AA Purchase :: aa_name:%s aa_id:%i at cost:%i in zoneid:%i instid:%i", aa2->name, aa2->id, real_cost, this->GetZoneID(), this->GetInstanceID());
|
||||||
QServ->PlayerLogEvent(Player_Log_AA_Purchases, this->CharacterID(), event_desc);
|
QServ->PlayerLogEvent(Player_Log_AA_Purchases, this->CharacterID(), event_desc);
|
||||||
@ -1522,13 +1521,13 @@ bool ZoneDatabase::LoadAAEffects2() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
void Client::ResetAA(){
|
void Client::ResetAA(){
|
||||||
RefundAA();
|
RefundAA();
|
||||||
uint32 i;
|
uint32 i;
|
||||||
for(i=0;i<MAX_PP_AA_ARRAY;i++){
|
for(i=0;i<MAX_PP_AA_ARRAY;i++){
|
||||||
aa[i]->AA = 0;
|
aa[i]->AA = 0;
|
||||||
aa[i]->value = 0;
|
aa[i]->value = 0;
|
||||||
m_pp.aa_array[MAX_PP_AA_ARRAY].AA = 0;
|
m_pp.aa_array[MAX_PP_AA_ARRAY].AA = 0;
|
||||||
m_pp.aa_array[MAX_PP_AA_ARRAY].value = 0;
|
m_pp.aa_array[MAX_PP_AA_ARRAY].value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::map<uint32,uint8>::iterator itr;
|
std::map<uint32,uint8>::iterator itr;
|
||||||
@ -1544,7 +1543,7 @@ void Client::ResetAA(){
|
|||||||
m_pp.raid_leadership_exp = 0;
|
m_pp.raid_leadership_exp = 0;
|
||||||
|
|
||||||
database.DeleteCharacterAAs(this->CharacterID());
|
database.DeleteCharacterAAs(this->CharacterID());
|
||||||
SaveAA();
|
SaveAA();
|
||||||
SendAATable();
|
SendAATable();
|
||||||
database.DeleteCharacterLeadershipAAs(this->CharacterID());
|
database.DeleteCharacterLeadershipAAs(this->CharacterID());
|
||||||
Kick();
|
Kick();
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
extern volatile bool ZoneLoaded;
|
extern volatile bool ZoneLoaded;
|
||||||
|
|
||||||
// This constructor is used during the bot create command
|
// This constructor is used during the bot create command
|
||||||
Bot::Bot(NPCType npcTypeData, Client* botOwner) : NPC(&npcTypeData, 0, 0, 0, 0, 0, 0, false), rest_timer(1) {
|
Bot::Bot(NPCType npcTypeData, Client* botOwner) : NPC(&npcTypeData, nullptr, xyz_heading::Origin(), 0, false), rest_timer(1) {
|
||||||
if(botOwner) {
|
if(botOwner) {
|
||||||
this->SetBotOwner(botOwner);
|
this->SetBotOwner(botOwner);
|
||||||
this->_botOwnerCharacterID = botOwner->CharacterID();
|
this->_botOwnerCharacterID = botOwner->CharacterID();
|
||||||
@ -99,7 +99,7 @@ Bot::Bot(NPCType npcTypeData, Client* botOwner) : NPC(&npcTypeData, 0, 0, 0, 0,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This constructor is used when the bot is loaded out of the database
|
// This constructor is used when the bot is loaded out of the database
|
||||||
Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double totalPlayTime, uint32 lastZoneId, NPCType npcTypeData) : NPC(&npcTypeData, 0, 0, 0, 0, 0, 0, false), rest_timer(1) {
|
Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double totalPlayTime, uint32 lastZoneId, NPCType npcTypeData) : NPC(&npcTypeData, nullptr, xyz_heading::Origin(), 0, false), rest_timer(1) {
|
||||||
this->_botOwnerCharacterID = botOwnerCharacterID;
|
this->_botOwnerCharacterID = botOwnerCharacterID;
|
||||||
|
|
||||||
if(this->_botOwnerCharacterID > 0) {
|
if(this->_botOwnerCharacterID > 0) {
|
||||||
|
|||||||
@ -6422,8 +6422,11 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
|||||||
if(summon_count > MAX_SWARM_PETS)
|
if(summon_count > MAX_SWARM_PETS)
|
||||||
summon_count = MAX_SWARM_PETS;
|
summon_count = MAX_SWARM_PETS;
|
||||||
|
|
||||||
static const float swarm_pet_x[MAX_SWARM_PETS] = { 5, -5, 5, -5, 10, -10, 10, -10, 8, -8, 8, -8 };
|
static const xy_location swarmPetLocations[MAX_SWARM_PETS] = {
|
||||||
static const float swarm_pet_y[MAX_SWARM_PETS] = { 5, 5, -5, -5, 10, 10, -10, -10, 8, 8, -8, -8 };
|
{5, 5}, {-5, 5}, {5, -5}, {-5, -5},
|
||||||
|
{10, 10}, {-10, 10}, {10, -10}, {-10, -10},
|
||||||
|
{8, 8}, {-8, 8}, {8, -8}, {-8, -8}
|
||||||
|
};
|
||||||
|
|
||||||
while(summon_count > 0) {
|
while(summon_count > 0) {
|
||||||
NPCType *npc_dup = nullptr;
|
NPCType *npc_dup = nullptr;
|
||||||
@ -6435,8 +6438,8 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid
|
|||||||
NPC* npca = new NPC(
|
NPC* npca = new NPC(
|
||||||
(npc_dup!=nullptr)?npc_dup:npc_type, //make sure we give the NPC the correct data pointer
|
(npc_dup!=nullptr)?npc_dup:npc_type, //make sure we give the NPC the correct data pointer
|
||||||
0,
|
0,
|
||||||
GetX()+swarm_pet_x[summon_count], GetY()+swarm_pet_y[summon_count],
|
GetPosition()+swarmPetLocations[summon_count],
|
||||||
GetZ(), GetHeading(), FlyMode3);
|
FlyMode3);
|
||||||
|
|
||||||
if(!npca->GetSwarmInfo()){
|
if(!npca->GetSwarmInfo()){
|
||||||
AA_SwarmPetInfo* nSI = new AA_SwarmPetInfo;
|
AA_SwarmPetInfo* nSI = new AA_SwarmPetInfo;
|
||||||
|
|||||||
@ -2489,7 +2489,7 @@ void command_npctypespawn(Client *c, const Seperator *sep)
|
|||||||
const NPCType* tmp = 0;
|
const NPCType* tmp = 0;
|
||||||
if ((tmp = database.GetNPCType(atoi(sep->arg[1])))) {
|
if ((tmp = database.GetNPCType(atoi(sep->arg[1])))) {
|
||||||
//tmp->fixedZ = 1;
|
//tmp->fixedZ = 1;
|
||||||
NPC* npc = new NPC(tmp, 0, c->GetX(), c->GetY(), c->GetZ(), c->GetHeading(), FlyMode3);
|
NPC* npc = new NPC(tmp, 0, c->GetPosition(), FlyMode3);
|
||||||
if (npc && sep->IsNumber(2))
|
if (npc && sep->IsNumber(2))
|
||||||
npc->SetNPCFactionID(atoi(sep->arg[2]));
|
npc->SetNPCFactionID(atoi(sep->arg[2]));
|
||||||
|
|
||||||
|
|||||||
@ -315,7 +315,9 @@ void Client::GoFish()
|
|||||||
if(npc_chance < MakeRandomInt(0, 99)) {
|
if(npc_chance < MakeRandomInt(0, 99)) {
|
||||||
const NPCType* tmp = database.GetNPCType(npc_id);
|
const NPCType* tmp = database.GetNPCType(npc_id);
|
||||||
if(tmp != nullptr) {
|
if(tmp != nullptr) {
|
||||||
NPC* npc = new NPC(tmp, nullptr, GetX()+3, GetY(), GetZ(), GetHeading(), FlyMode3);
|
auto positionNPC = GetPosition();
|
||||||
|
positionNPC.m_X = positionNPC.m_X + 3;
|
||||||
|
NPC* npc = new NPC(tmp, nullptr, positionNPC, FlyMode3);
|
||||||
npc->AddLootTable();
|
npc->AddLootTable();
|
||||||
|
|
||||||
npc->AddToHateList(this, 1, 0, false); //no help yelling
|
npc->AddToHateList(this, 1, 0, false); //no help yelling
|
||||||
|
|||||||
@ -29,7 +29,7 @@ std::map<uint16, const NPCType *> Horse::horse_types;
|
|||||||
LinkedList<NPCType *> horses_auto_delete;
|
LinkedList<NPCType *> horses_auto_delete;
|
||||||
|
|
||||||
Horse::Horse(Client *_owner, uint16 spell_id, float x, float y, float z, float heading)
|
Horse::Horse(Client *_owner, uint16 spell_id, float x, float y, float z, float heading)
|
||||||
: NPC(GetHorseType(spell_id), nullptr, x, y, z, heading, FlyMode3)
|
: NPC(GetHorseType(spell_id), nullptr, xyz_heading(x, y, z, heading), FlyMode3)
|
||||||
{
|
{
|
||||||
//give the horse its proper name.
|
//give the horse its proper name.
|
||||||
strn0cpy(name, _owner->GetCleanName(), 55);
|
strn0cpy(name, _owner->GetCleanName(), 55);
|
||||||
|
|||||||
@ -124,7 +124,7 @@ void register_event(std::string package_name, std::string name, int evt, luabind
|
|||||||
e.encounter_name = name;
|
e.encounter_name = name;
|
||||||
e.lua_reference = func;
|
e.lua_reference = func;
|
||||||
e.event_id = static_cast<QuestEventID>(evt);
|
e.event_id = static_cast<QuestEventID>(evt);
|
||||||
|
|
||||||
auto liter = lua_encounter_events_registered.find(package_name);
|
auto liter = lua_encounter_events_registered.find(package_name);
|
||||||
if(liter == lua_encounter_events_registered.end()) {
|
if(liter == lua_encounter_events_registered.end()) {
|
||||||
std::list<lua_registered_event> elist;
|
std::list<lua_registered_event> elist;
|
||||||
@ -201,7 +201,7 @@ void unregister_player_event(int evt) {
|
|||||||
void register_item_event(std::string name, int evt, int item_id, luabind::adl::object func) {
|
void register_item_event(std::string name, int evt, int item_id, luabind::adl::object func) {
|
||||||
std::string package_name = "item_";
|
std::string package_name = "item_";
|
||||||
package_name += std::to_string(static_cast<long long>(item_id));
|
package_name += std::to_string(static_cast<long long>(item_id));
|
||||||
|
|
||||||
if(luabind::type(func) == LUA_TFUNCTION) {
|
if(luabind::type(func) == LUA_TFUNCTION) {
|
||||||
register_event(package_name, name, evt, func);
|
register_event(package_name, name, evt, func);
|
||||||
}
|
}
|
||||||
@ -1036,7 +1036,7 @@ void lua_add_spawn_point(luabind::adl::object table) {
|
|||||||
int condition_min_value = 0;
|
int condition_min_value = 0;
|
||||||
bool enabled = true;
|
bool enabled = true;
|
||||||
int animation = 0;
|
int animation = 0;
|
||||||
|
|
||||||
auto cur = table["spawn2_id"];
|
auto cur = table["spawn2_id"];
|
||||||
if(luabind::type(cur) != LUA_TNIL) {
|
if(luabind::type(cur) != LUA_TNIL) {
|
||||||
try {
|
try {
|
||||||
@ -1284,7 +1284,7 @@ void lua_create_npc(luabind::adl::object table, float x, float y, float z, float
|
|||||||
if(luabind::type(table) != LUA_TTABLE) {
|
if(luabind::type(table) != LUA_TTABLE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
NPCType* npc_type = new NPCType;
|
NPCType* npc_type = new NPCType;
|
||||||
memset(npc_type, 0, sizeof(NPCType));
|
memset(npc_type, 0, sizeof(NPCType));
|
||||||
|
|
||||||
@ -1391,7 +1391,7 @@ void lua_create_npc(luabind::adl::object table, float x, float y, float z, float
|
|||||||
LuaCreateNPCParse(raid_target, bool, false);
|
LuaCreateNPCParse(raid_target, bool, false);
|
||||||
LuaCreateNPCParse(probability, uint8, 0);
|
LuaCreateNPCParse(probability, uint8, 0);
|
||||||
|
|
||||||
NPC* npc = new NPC(npc_type, nullptr, x, y, z, heading, FlyMode3);
|
NPC* npc = new NPC(npc_type, nullptr, xyz_heading(x, y, z, heading), FlyMode3);
|
||||||
npc->GiveNPCTypeData(npc_type);
|
npc->GiveNPCTypeData(npc_type);
|
||||||
entity_list.AddNPC(npc);
|
entity_list.AddNPC(npc);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
extern volatile bool ZoneLoaded;
|
extern volatile bool ZoneLoaded;
|
||||||
|
|
||||||
Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
|
Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
|
||||||
: NPC(d, 0, x, y, z, heading, 0, false), endupkeep_timer(1000), rest_timer(1), confidence_timer(6000), check_target_timer(2000)
|
: NPC(d, nullptr, xyz_heading(x, y, z, heading), 0, false), endupkeep_timer(1000), rest_timer(1), confidence_timer(6000), check_target_timer(2000)
|
||||||
{
|
{
|
||||||
base_hp = d->max_hp;
|
base_hp = d->max_hp;
|
||||||
base_mana = d->Mana;
|
base_mana = d->Mana;
|
||||||
@ -4925,11 +4925,11 @@ Merc* Merc::LoadMerc(Client *c, MercTemplate* merc_template, uint32 merchant_id,
|
|||||||
if(merc_template)
|
if(merc_template)
|
||||||
{
|
{
|
||||||
//TODO: Maybe add a way of updating client merc stats in a seperate function? like, for example, on leveling up.
|
//TODO: Maybe add a way of updating client merc stats in a seperate function? like, for example, on leveling up.
|
||||||
const NPCType* npc_type_to_copy = database.GetMercType(merc_template->MercNPCID, merc_template->RaceID, c->GetLevel());
|
const NPCType* npc_type_to_copy = database.GetMercType(merc_template->MercNPCID, merc_template->RaceID, c->GetLevel());
|
||||||
if(npc_type_to_copy != nullptr)
|
if(npc_type_to_copy != nullptr)
|
||||||
{
|
{
|
||||||
//This is actually a very terrible method of assigning stats, and should be changed at some point. See the comment in merc's deconstructor.
|
//This is actually a very terrible method of assigning stats, and should be changed at some point. See the comment in merc's deconstructor.
|
||||||
NPCType* npc_type = new NPCType;
|
NPCType* npc_type = new NPCType;
|
||||||
memset(npc_type, 0, sizeof(NPCType));
|
memset(npc_type, 0, sizeof(NPCType));
|
||||||
memcpy(npc_type, npc_type_to_copy, sizeof(NPCType));
|
memcpy(npc_type, npc_type_to_copy, sizeof(NPCType));
|
||||||
if(c && !updateFromDB)
|
if(c && !updateFromDB)
|
||||||
@ -5099,7 +5099,7 @@ bool Merc::Spawn(Client *owner) {
|
|||||||
entity_list.AddMerc(this, true, true);
|
entity_list.AddMerc(this, true, true);
|
||||||
|
|
||||||
SendPosition();
|
SendPosition();
|
||||||
|
|
||||||
if (MERC_DEBUG > 0)
|
if (MERC_DEBUG > 0)
|
||||||
owner->Message(7, "Mercenary Debug: Spawn.");
|
owner->Message(7, "Mercenary Debug: Spawn.");
|
||||||
|
|
||||||
@ -5125,7 +5125,7 @@ void Client::SendMercResponsePackets(uint32 ResponseType)
|
|||||||
break;
|
break;
|
||||||
case 3: //Mercenary failed to spawn!
|
case 3: //Mercenary failed to spawn!
|
||||||
SendMercMerchantResponsePacket(3);
|
SendMercMerchantResponsePacket(3);
|
||||||
break;
|
break;
|
||||||
case 4: //Mercenaries are not allowed in raids!
|
case 4: //Mercenaries are not allowed in raids!
|
||||||
SendMercMerchantResponsePacket(4);
|
SendMercMerchantResponsePacket(4);
|
||||||
break;
|
break;
|
||||||
@ -5289,7 +5289,7 @@ void Client::UpdateMercTimer()
|
|||||||
{
|
{
|
||||||
SendMercResponsePackets(16);
|
SendMercResponsePackets(16);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MERC_DEBUG > 0)
|
if (MERC_DEBUG > 0)
|
||||||
Message(7, "Mercenary Debug: UpdateMercTimer Complete.");
|
Message(7, "Mercenary Debug: UpdateMercTimer Complete.");
|
||||||
|
|
||||||
@ -5312,7 +5312,7 @@ bool Client::CheckCanHireMerc(Mob* merchant, uint32 template_id) {
|
|||||||
MercTemplate* mercTemplate = zone->GetMercTemplate(template_id);
|
MercTemplate* mercTemplate = zone->GetMercTemplate(template_id);
|
||||||
|
|
||||||
//check for suspended merc
|
//check for suspended merc
|
||||||
if(GetMercInfo().mercid != 0 && GetMercInfo().IsSuspended) {
|
if(GetMercInfo().mercid != 0 && GetMercInfo().IsSuspended) {
|
||||||
SendMercResponsePackets(6);
|
SendMercResponsePackets(6);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -5343,7 +5343,7 @@ bool Client::CheckCanHireMerc(Mob* merchant, uint32 template_id) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MERC_DEBUG > 0)
|
if (MERC_DEBUG > 0)
|
||||||
Message(7, "Mercenary Debug: CheckCanHireMerc True.");
|
Message(7, "Mercenary Debug: CheckCanHireMerc True.");
|
||||||
|
|
||||||
@ -5417,7 +5417,7 @@ bool Client::CheckCanSpawnMerc(uint32 template_id) {
|
|||||||
SendMercResponsePackets(9);
|
SendMercResponsePackets(9);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MERC_DEBUG > 0)
|
if (MERC_DEBUG > 0)
|
||||||
Message(7, "Mercenary Debug: CheckCanSpawnMerc True.");
|
Message(7, "Mercenary Debug: CheckCanSpawnMerc True.");
|
||||||
|
|
||||||
@ -5440,7 +5440,7 @@ bool Client::CheckCanUnsuspendMerc() {
|
|||||||
Message(0, "You must wait %i seconds before unsuspending your mercenary.", GetPTimers().GetRemainingTime(pTimerMercSuspend));
|
Message(0, "You must wait %i seconds before unsuspending your mercenary.", GetPTimers().GetRemainingTime(pTimerMercSuspend));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MERC_DEBUG > 0)
|
if (MERC_DEBUG > 0)
|
||||||
Message(7, "Mercenary Debug: CheckCanUnsuspendMerc True.");
|
Message(7, "Mercenary Debug: CheckCanUnsuspendMerc True.");
|
||||||
|
|
||||||
@ -5588,7 +5588,7 @@ void Client::SendMercTimer(Merc* merc) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::SpawnMerc(Merc* merc, bool setMaxStats) {
|
void Client::SpawnMerc(Merc* merc, bool setMaxStats) {
|
||||||
|
|
||||||
if (!merc || !CheckCanSpawnMerc(merc->GetMercTemplateID()))
|
if (!merc || !CheckCanSpawnMerc(merc->GetMercTemplateID()))
|
||||||
{
|
{
|
||||||
@ -5607,7 +5607,7 @@ void Client::SpawnMerc(Merc* merc, bool setMaxStats) {
|
|||||||
GetMercInfo().SuspendedTime = 0;
|
GetMercInfo().SuspendedTime = 0;
|
||||||
|
|
||||||
//SendMercTimer(merc);
|
//SendMercTimer(merc);
|
||||||
|
|
||||||
if (MERC_DEBUG > 0)
|
if (MERC_DEBUG > 0)
|
||||||
Message(7, "Mercenary Debug: SpawnMerc Success.");
|
Message(7, "Mercenary Debug: SpawnMerc Success.");
|
||||||
|
|
||||||
@ -5632,12 +5632,12 @@ bool Merc::Suspend() {
|
|||||||
mercOwner->GetMercTimer()->Disable();
|
mercOwner->GetMercTimer()->Disable();
|
||||||
mercOwner->SendMercSuspendResponsePacket(mercOwner->GetMercInfo().SuspendedTime);
|
mercOwner->SendMercSuspendResponsePacket(mercOwner->GetMercInfo().SuspendedTime);
|
||||||
mercOwner->SendMercTimer(this);
|
mercOwner->SendMercTimer(this);
|
||||||
|
|
||||||
Depop();
|
Depop();
|
||||||
|
|
||||||
// Start the timer to send the packet that refreshes the Unsuspend Button
|
// Start the timer to send the packet that refreshes the Unsuspend Button
|
||||||
mercOwner->GetPTimers().Start(pTimerMercSuspend, RuleI(Mercs, SuspendIntervalS));
|
mercOwner->GetPTimers().Start(pTimerMercSuspend, RuleI(Mercs, SuspendIntervalS));
|
||||||
|
|
||||||
if (MERC_DEBUG > 0)
|
if (MERC_DEBUG > 0)
|
||||||
mercOwner->Message(7, "Mercenary Debug: Suspend Complete.");
|
mercOwner->Message(7, "Mercenary Debug: Suspend Complete.");
|
||||||
|
|
||||||
@ -5739,7 +5739,7 @@ bool Client::DismissMerc(uint32 MercID) {
|
|||||||
if (MERC_DEBUG > 0)
|
if (MERC_DEBUG > 0)
|
||||||
Message(7, "Mercenary Debug: Dismiss Successful.");
|
Message(7, "Mercenary Debug: Dismiss Successful.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetMerc())
|
if (GetMerc())
|
||||||
{
|
{
|
||||||
GetMerc()->Depop();
|
GetMerc()->Depop();
|
||||||
@ -5907,7 +5907,7 @@ bool Merc::MercJoinClientGroup() {
|
|||||||
if(MERC_DEBUG > 0)
|
if(MERC_DEBUG > 0)
|
||||||
mercOwner->Message(7, "Mercenary Debug: Mercenary disbanded new group.");
|
mercOwner->Message(7, "Mercenary Debug: Mercenary disbanded new group.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (AddMercToGroup(this, mercOwner->GetGroup()))
|
else if (AddMercToGroup(this, mercOwner->GetGroup()))
|
||||||
{
|
{
|
||||||
@ -5997,7 +5997,7 @@ Merc* Client::GetMerc() {
|
|||||||
Message(7, "Mercenary Debug: GetMerc Owner Mismatch.");
|
Message(7, "Mercenary Debug: GetMerc Owner Mismatch.");
|
||||||
return (nullptr);
|
return (nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MERC_DEBUG > 0)
|
if (MERC_DEBUG > 0)
|
||||||
//Message(7, "Mercenary Debug: GetMerc Success.");
|
//Message(7, "Mercenary Debug: GetMerc Success.");
|
||||||
|
|
||||||
|
|||||||
14
zone/npc.cpp
14
zone/npc.cpp
@ -54,7 +54,7 @@ extern EntityList entity_list;
|
|||||||
|
|
||||||
#include "quest_parser_collection.h"
|
#include "quest_parser_collection.h"
|
||||||
|
|
||||||
NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float heading, int iflymode, bool IsCorpse)
|
NPC::NPC(const NPCType* d, Spawn2* in_respawn, const xyz_heading& position, int iflymode, bool IsCorpse)
|
||||||
: Mob(d->name,
|
: Mob(d->name,
|
||||||
d->lastname,
|
d->lastname,
|
||||||
d->max_hp,
|
d->max_hp,
|
||||||
@ -68,10 +68,10 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float
|
|||||||
d->npc_id,
|
d->npc_id,
|
||||||
d->size,
|
d->size,
|
||||||
d->runspeed,
|
d->runspeed,
|
||||||
heading,
|
position.m_Heading,
|
||||||
x,
|
position.m_X,
|
||||||
y,
|
position.m_Y,
|
||||||
z,
|
position.m_Z,
|
||||||
d->light,
|
d->light,
|
||||||
d->texture,
|
d->texture,
|
||||||
d->helmtexture,
|
d->helmtexture,
|
||||||
@ -114,7 +114,7 @@ NPC::NPC(const NPCType* d, Spawn2* in_respawn, float x, float y, float z, float
|
|||||||
sendhpupdate_timer(1000),
|
sendhpupdate_timer(1000),
|
||||||
enraged_timer(1000),
|
enraged_timer(1000),
|
||||||
taunt_timer(TauntReuseTime * 1000),
|
taunt_timer(TauntReuseTime * 1000),
|
||||||
m_SpawnPoint(x,y,z,heading),
|
m_SpawnPoint(position),
|
||||||
m_GuardPoint(-1,-1,-1,0),
|
m_GuardPoint(-1,-1,-1,0),
|
||||||
m_GuardPointSaved(0,0,0,0)
|
m_GuardPointSaved(0,0,0,0)
|
||||||
{
|
{
|
||||||
@ -932,7 +932,7 @@ NPC* NPC::SpawnNPC(const char* spawncommand, const xyz_heading& position, Client
|
|||||||
npc_type->prim_melee_type = 28;
|
npc_type->prim_melee_type = 28;
|
||||||
npc_type->sec_melee_type = 28;
|
npc_type->sec_melee_type = 28;
|
||||||
|
|
||||||
NPC* npc = new NPC(npc_type, 0, position.m_X, position.m_Y, position.m_Z, position.m_Heading, FlyMode3);
|
NPC* npc = new NPC(npc_type, nullptr, position, FlyMode3);
|
||||||
npc->GiveNPCTypeData(npc_type);
|
npc->GiveNPCTypeData(npc_type);
|
||||||
|
|
||||||
entity_list.AddNPC(npc);
|
entity_list.AddNPC(npc);
|
||||||
|
|||||||
@ -94,10 +94,10 @@ class AA_SwarmPetInfo;
|
|||||||
class NPC : public Mob
|
class NPC : public Mob
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static NPC* SpawnNPC(const char* spawncommand, const xyz_heading& position, Client* client = 0);
|
static NPC* SpawnNPC(const char* spawncommand, const xyz_heading& position, Client* client = nullptr);
|
||||||
static int8 GetAILevel(bool iForceReRead = false);
|
static int8 GetAILevel(bool iForceReRead = false);
|
||||||
|
|
||||||
NPC(const NPCType* data, Spawn2* respawn, float x, float y, float z, float heading, int iflymode, bool IsCorpse = false);
|
NPC(const NPCType* data, Spawn2* respawn, const xyz_heading& position, int iflymode, bool IsCorpse = false);
|
||||||
|
|
||||||
virtual ~NPC();
|
virtual ~NPC();
|
||||||
|
|
||||||
|
|||||||
@ -587,8 +587,8 @@ void PathManager::SpawnPathNodes()
|
|||||||
npc_type->CHA = 150;
|
npc_type->CHA = 150;
|
||||||
|
|
||||||
npc_type->findable = 1;
|
npc_type->findable = 1;
|
||||||
|
auto position = xyz_heading(PathNodes[i].v.x, PathNodes[i].v.y, PathNodes[i].v.z, 0.0f);
|
||||||
NPC* npc = new NPC(npc_type, 0, PathNodes[i].v.x, PathNodes[i].v.y, PathNodes[i].v.z, 0, FlyMode1);
|
NPC* npc = new NPC(npc_type, nullptr, position, FlyMode1);
|
||||||
npc->GiveNPCTypeData(npc_type);
|
npc->GiveNPCTypeData(npc_type);
|
||||||
|
|
||||||
entity_list.AddNPC(npc, true, true);
|
entity_list.AddNPC(npc, true, true);
|
||||||
@ -1578,7 +1578,8 @@ int32 PathManager::AddNode(float x, float y, float z, float best_z, int32 reques
|
|||||||
npc_type->CHA = 150;
|
npc_type->CHA = 150;
|
||||||
npc_type->findable = 1;
|
npc_type->findable = 1;
|
||||||
|
|
||||||
NPC* npc = new NPC(npc_type, 0, new_node.v.x, new_node.v.y, new_node.v.z, 0, FlyMode1);
|
auto position = xyz_heading(new_node.v.x, new_node.v.y, new_node.v.z, 0.0f);
|
||||||
|
NPC* npc = new NPC(npc_type, nullptr, position, FlyMode1);
|
||||||
npc->GiveNPCTypeData(npc_type);
|
npc->GiveNPCTypeData(npc_type);
|
||||||
entity_list.AddNPC(npc, true, true);
|
entity_list.AddNPC(npc, true, true);
|
||||||
|
|
||||||
@ -1638,7 +1639,8 @@ int32 PathManager::AddNode(float x, float y, float z, float best_z, int32 reques
|
|||||||
npc_type->CHA = 150;
|
npc_type->CHA = 150;
|
||||||
npc_type->findable = 1;
|
npc_type->findable = 1;
|
||||||
|
|
||||||
NPC* npc = new NPC(npc_type, 0, new_node.v.x, new_node.v.y, new_node.v.z, 0, FlyMode1);
|
auto position = xyz_heading(new_node.v.x, new_node.v.y, new_node.v.z, 0.0f);
|
||||||
|
NPC* npc = new NPC(npc_type, nullptr, position, FlyMode1);
|
||||||
npc->GiveNPCTypeData(npc_type);
|
npc->GiveNPCTypeData(npc_type);
|
||||||
entity_list.AddNPC(npc, true, true);
|
entity_list.AddNPC(npc, true, true);
|
||||||
|
|
||||||
|
|||||||
@ -435,7 +435,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower,
|
|||||||
into walls or objects (+10), this sometimes creates the "ghost" effect. I changed to +2 (as close as I
|
into walls or objects (+10), this sometimes creates the "ghost" effect. I changed to +2 (as close as I
|
||||||
could get while it still looked good). I also noticed this can happen if an NPC is spawned on the same spot of another or in a related bad spot.*/
|
could get while it still looked good). I also noticed this can happen if an NPC is spawned on the same spot of another or in a related bad spot.*/
|
||||||
Pet::Pet(NPCType *type_data, Mob *owner, PetType type, uint16 spell_id, int16 power)
|
Pet::Pet(NPCType *type_data, Mob *owner, PetType type, uint16 spell_id, int16 power)
|
||||||
: NPC(type_data, 0, owner->GetX()+2, owner->GetY()+2, owner->GetZ(), owner->GetHeading(), FlyMode3)
|
: NPC(type_data, 0, owner->GetPosition() + xy_location(2, 2), FlyMode3)
|
||||||
{
|
{
|
||||||
GiveNPCTypeData(type_data);
|
GiveNPCTypeData(type_data);
|
||||||
typeofpet = type;
|
typeofpet = type;
|
||||||
|
|||||||
@ -245,7 +245,7 @@ Mob* QuestManager::spawn2(int npc_type, int grid, int unused, float x, float y,
|
|||||||
const NPCType* tmp = 0;
|
const NPCType* tmp = 0;
|
||||||
if (tmp = database.GetNPCType(npc_type))
|
if (tmp = database.GetNPCType(npc_type))
|
||||||
{
|
{
|
||||||
NPC* npc = new NPC(tmp, 0, x, y, z, heading, FlyMode3);
|
NPC* npc = new NPC(tmp, nullptr, xyz_heading(x, y, z, heading), FlyMode3);
|
||||||
npc->AddLootTable();
|
npc->AddLootTable();
|
||||||
entity_list.AddNPC(npc,true,true);
|
entity_list.AddNPC(npc,true,true);
|
||||||
if(grid > 0)
|
if(grid > 0)
|
||||||
@ -267,7 +267,7 @@ Mob* QuestManager::unique_spawn(int npc_type, int grid, int unused, float x, flo
|
|||||||
const NPCType* tmp = 0;
|
const NPCType* tmp = 0;
|
||||||
if (tmp = database.GetNPCType(npc_type))
|
if (tmp = database.GetNPCType(npc_type))
|
||||||
{
|
{
|
||||||
NPC* npc = new NPC(tmp, 0, x, y, z, heading, FlyMode3);
|
NPC* npc = new NPC(tmp, nullptr, xyz_heading(x, y, z, heading), FlyMode3);
|
||||||
npc->AddLootTable();
|
npc->AddLootTable();
|
||||||
entity_list.AddNPC(npc,true,true);
|
entity_list.AddNPC(npc,true,true);
|
||||||
if(grid > 0)
|
if(grid > 0)
|
||||||
@ -340,8 +340,8 @@ Mob* QuestManager::spawn_from_spawn2(uint32 spawn2_id)
|
|||||||
database.UpdateSpawn2Timeleft(spawn2_id, zone->GetInstanceID(), 0);
|
database.UpdateSpawn2Timeleft(spawn2_id, zone->GetInstanceID(), 0);
|
||||||
found_spawn->SetCurrentNPCID(npcid);
|
found_spawn->SetCurrentNPCID(npcid);
|
||||||
|
|
||||||
NPC* npc = new NPC(tmp, found_spawn, found_spawn->GetX(), found_spawn->GetY(), found_spawn->GetZ(),
|
auto position = xyz_heading(found_spawn->GetX(), found_spawn->GetY(), found_spawn->GetZ(), found_spawn->GetHeading());
|
||||||
found_spawn->GetHeading(), FlyMode3);
|
NPC* npc = new NPC(tmp, found_spawn, position, FlyMode3);
|
||||||
|
|
||||||
found_spawn->SetNPCPointer(npc);
|
found_spawn->SetNPCPointer(npc);
|
||||||
npc->AddLootTable();
|
npc->AddLootTable();
|
||||||
@ -1600,26 +1600,20 @@ void QuestManager::setnextinchpevent(int at) {
|
|||||||
owner->SetNextIncHPEvent(at);
|
owner->SetNextIncHPEvent(at);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::respawn(int npc_type, int grid) {
|
void QuestManager::respawn(int npcTypeID, int grid) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (!owner || !owner->IsNPC())
|
if (!owner || !owner->IsNPC())
|
||||||
return;
|
return;
|
||||||
float x,y,z,h;
|
|
||||||
|
|
||||||
x = owner->GetX();
|
|
||||||
y = owner->GetY();
|
|
||||||
z = owner->GetZ();
|
|
||||||
h = owner->GetHeading();
|
|
||||||
|
|
||||||
running_quest e = quests_running_.top();
|
running_quest e = quests_running_.top();
|
||||||
e.depop_npc = true;
|
e.depop_npc = true;
|
||||||
quests_running_.pop();
|
quests_running_.pop();
|
||||||
quests_running_.push(e);
|
quests_running_.push(e);
|
||||||
|
|
||||||
const NPCType* tmp = 0;
|
const NPCType* npcType = nullptr;
|
||||||
if ((tmp = database.GetNPCType(npc_type)))
|
if ((npcType = database.GetNPCType(npcTypeID)))
|
||||||
{
|
{
|
||||||
owner = new NPC(tmp, 0, x, y, z, h, FlyMode3);
|
owner = new NPC(npcType, nullptr, owner->GetPosition(), FlyMode3);
|
||||||
owner->CastToNPC()->AddLootTable();
|
owner->CastToNPC()->AddLootTable();
|
||||||
entity_list.AddNPC(owner->CastToNPC(),true,true);
|
entity_list.AddNPC(owner->CastToNPC(),true,true);
|
||||||
if(grid > 0)
|
if(grid > 0)
|
||||||
|
|||||||
@ -217,7 +217,7 @@ bool Spawn2::Process() {
|
|||||||
database.UpdateSpawn2Timeleft(spawn2_id, zone->GetInstanceID(), 0);
|
database.UpdateSpawn2Timeleft(spawn2_id, zone->GetInstanceID(), 0);
|
||||||
|
|
||||||
currentnpcid = npcid;
|
currentnpcid = npcid;
|
||||||
NPC* npc = new NPC(tmp, this, x, y, z, heading, FlyMode3);
|
NPC* npc = new NPC(tmp, this, xyz_heading(x, y, z, heading), FlyMode3);
|
||||||
|
|
||||||
npc->mod_prespawn(this);
|
npc->mod_prespawn(this);
|
||||||
|
|
||||||
|
|||||||
@ -144,7 +144,9 @@ void Trap::Trigger(Mob* trigger)
|
|||||||
{
|
{
|
||||||
if ((tmp = database.GetNPCType(effectvalue)))
|
if ((tmp = database.GetNPCType(effectvalue)))
|
||||||
{
|
{
|
||||||
NPC* new_npc = new NPC(tmp, 0, x-5+MakeRandomInt(0, 10), y-5+MakeRandomInt(0, 10), z-5+MakeRandomInt(0, 10), MakeRandomInt(0, 249), FlyMode3);
|
auto randomOffset = xyz_heading(-5 + MakeRandomInt(0, 10),-5 + MakeRandomInt(0, 10),-5 + MakeRandomInt(0, 10), MakeRandomInt(0, 249));
|
||||||
|
auto position = randomOffset + xyz_location(x, y, z);
|
||||||
|
NPC* new_npc = new NPC(tmp, nullptr, position, FlyMode3);
|
||||||
new_npc->AddLootTable();
|
new_npc->AddLootTable();
|
||||||
entity_list.AddNPC(new_npc);
|
entity_list.AddNPC(new_npc);
|
||||||
new_npc->AddToHateList(trigger,1);
|
new_npc->AddToHateList(trigger,1);
|
||||||
@ -165,7 +167,9 @@ void Trap::Trigger(Mob* trigger)
|
|||||||
{
|
{
|
||||||
if ((tmp = database.GetNPCType(effectvalue)))
|
if ((tmp = database.GetNPCType(effectvalue)))
|
||||||
{
|
{
|
||||||
NPC* new_npc = new NPC(tmp, 0, x-2+MakeRandomInt(0, 5), y-2+MakeRandomInt(0, 5), z-2+MakeRandomInt(0, 5), MakeRandomInt(0, 249), FlyMode3);
|
auto randomOffset = xyz_heading(-2 + MakeRandomInt(0, 5), -2 + MakeRandomInt(0, 5), -2 + MakeRandomInt(0, 5), MakeRandomInt(0, 249));
|
||||||
|
auto position = randomOffset + xyz_location(x, y, z);
|
||||||
|
NPC* new_npc = new NPC(tmp, nullptr, position, FlyMode3);
|
||||||
new_npc->AddLootTable();
|
new_npc->AddLootTable();
|
||||||
entity_list.AddNPC(new_npc);
|
entity_list.AddNPC(new_npc);
|
||||||
new_npc->AddToHateList(trigger,1);
|
new_npc->AddToHateList(trigger,1);
|
||||||
@ -318,7 +322,7 @@ void Trap::CreateHiddenTrigger()
|
|||||||
make_npc->trackable = 0;
|
make_npc->trackable = 0;
|
||||||
make_npc->level = level;
|
make_npc->level = level;
|
||||||
strcpy(make_npc->special_abilities, "19,1^20,1^24,1^25,1");
|
strcpy(make_npc->special_abilities, "19,1^20,1^24,1^25,1");
|
||||||
NPC* npca = new NPC(make_npc, 0, x, y, z, 0, FlyMode3);
|
NPC* npca = new NPC(make_npc, nullptr, xyz_heading(x, y, z, 0.0f), FlyMode3);
|
||||||
npca->GiveNPCTypeData(make_npc);
|
npca->GiveNPCTypeData(make_npc);
|
||||||
entity_list.AddNPC(npca);
|
entity_list.AddNPC(npca);
|
||||||
|
|
||||||
|
|||||||
@ -103,7 +103,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
|
|||||||
}
|
}
|
||||||
zone->zonemap = Map::LoadMapFile(zone->map_name);
|
zone->zonemap = Map::LoadMapFile(zone->map_name);
|
||||||
zone->watermap = WaterMap::LoadWaterMapfile(zone->map_name);
|
zone->watermap = WaterMap::LoadWaterMapfile(zone->map_name);
|
||||||
zone->pathing = PathManager::LoadPathFile(zone->map_name);
|
zone->pathing = PathManager::LoadPathFile(zone->map_name);
|
||||||
|
|
||||||
char tmp[10];
|
char tmp[10];
|
||||||
if (database.GetVariable("loglevel",tmp, 9)) {
|
if (database.GetVariable("loglevel",tmp, 9)) {
|
||||||
@ -470,7 +470,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) {
|
|||||||
|
|
||||||
void Zone::GetMerchantDataForZoneLoad() {
|
void Zone::GetMerchantDataForZoneLoad() {
|
||||||
LogFile->write(EQEMuLog::Status, "Loading Merchant Lists...");
|
LogFile->write(EQEMuLog::Status, "Loading Merchant Lists...");
|
||||||
std::string query = StringFormat(
|
std::string query = StringFormat(
|
||||||
"SELECT "
|
"SELECT "
|
||||||
"DISTINCT ml.merchantid, "
|
"DISTINCT ml.merchantid, "
|
||||||
"ml.slot, "
|
"ml.slot, "
|
||||||
@ -488,14 +488,14 @@ void Zone::GetMerchantDataForZoneLoad() {
|
|||||||
"WHERE nt.merchant_id = ml.merchantid AND nt.id = se.npcid "
|
"WHERE nt.merchant_id = ml.merchantid AND nt.id = se.npcid "
|
||||||
"AND se.spawngroupid = s2.spawngroupid AND s2.zone = '%s' AND s2.version = %i "
|
"AND se.spawngroupid = s2.spawngroupid AND s2.zone = '%s' AND s2.version = %i "
|
||||||
"ORDER BY ml.slot ", GetShortName(), GetInstanceVersion());
|
"ORDER BY ml.slot ", GetShortName(), GetInstanceVersion());
|
||||||
auto results = database.QueryDatabase(query);
|
auto results = database.QueryDatabase(query);
|
||||||
std::map<uint32, std::list<MerchantList> >::iterator cur;
|
std::map<uint32, std::list<MerchantList> >::iterator cur;
|
||||||
uint32 npcid = 0;
|
uint32 npcid = 0;
|
||||||
if (results.RowCount() == 0) {
|
if (results.RowCount() == 0) {
|
||||||
LogFile->write(EQEMuLog::Debug, "No Merchant Data found for %s.", GetShortName());
|
LogFile->write(EQEMuLog::Debug, "No Merchant Data found for %s.", GetShortName());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
MerchantList ml;
|
MerchantList ml;
|
||||||
ml.id = atoul(row[0]);
|
ml.id = atoul(row[0]);
|
||||||
if (npcid != ml.id) {
|
if (npcid != ml.id) {
|
||||||
@ -2199,7 +2199,7 @@ void Zone::DoAdventureActions()
|
|||||||
const NPCType* tmp = database.GetNPCType(ds->data_id);
|
const NPCType* tmp = database.GetNPCType(ds->data_id);
|
||||||
if(tmp)
|
if(tmp)
|
||||||
{
|
{
|
||||||
NPC* npc = new NPC(tmp, 0, ds->assa_x, ds->assa_y, ds->assa_z, ds->assa_h, FlyMode3);
|
NPC* npc = new NPC(tmp, nullptr, xyz_heading(ds->assa_x, ds->assa_y, ds->assa_z, ds->assa_h), FlyMode3);
|
||||||
npc->AddLootTable();
|
npc->AddLootTable();
|
||||||
entity_list.AddNPC(npc);
|
entity_list.AddNPC(npc);
|
||||||
npc->Shout("Rarrrgh!");
|
npc->Shout("Rarrrgh!");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user