mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
[Cleanup] Add initiator/owner checks to various methods in questmgr.cpp (#3306)
* [Cleanup] Add initiator/owner checks to various methods in questmgr.cpp # Notes - Add `initiator` check to `quest::permaclass()`. - Add `initiator` check to `quest::permarace()`. - Add `initiator` check to `quest::permagender()`. - Add `initiator` check to `quest::scribespells()`. - Add `initiator` check to `quest::traindiscs()`. - Add `initiator` check to `quest::unscribespells()`. - Add `initiator` check to `quest::untraindiscs()`. - Cleanup `initiator` check in `quest::pvp()`. - Cleanup `initiator` check in `quest::movepc()`. - Cleanup `initiator` check in `quest::gmmove()`. - Cleanup `initiator` check in `quest::movegrp()`. - Add `owner` check to `quest::doanim()`. - Cleanup `initiator` check in `quest::addskill()`. - Cleanup `initiator` check in `quest::setlanguage()`. - Cleanup `initiator` check in `quest::setskill()`. * Update questmgr.cpp * Update questmgr.cpp * Update questmgr.cpp * Update questmgr.cpp
This commit is contained in:
parent
e3761cf2a3
commit
576f99f292
@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../common/classes.h"
|
#include "../common/classes.h"
|
||||||
|
#include "../common/data_verification.h"
|
||||||
#include "../common/global_define.h"
|
#include "../common/global_define.h"
|
||||||
#include "../common/rulesys.h"
|
#include "../common/rulesys.h"
|
||||||
#include "../common/skills.h"
|
#include "../common/skills.h"
|
||||||
@ -1156,7 +1157,11 @@ void QuestManager::surname(std::string last_name) {
|
|||||||
|
|
||||||
void QuestManager::permaclass(int class_id) {
|
void QuestManager::permaclass(int class_id) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
//Makes the client the class specified
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->SetBaseClass(class_id);
|
initiator->SetBaseClass(class_id);
|
||||||
initiator->Save(2);
|
initiator->Save(2);
|
||||||
initiator->Kick("Base class change by QuestManager");
|
initiator->Kick("Base class change by QuestManager");
|
||||||
@ -1164,7 +1169,11 @@ void QuestManager::permaclass(int class_id) {
|
|||||||
|
|
||||||
void QuestManager::permarace(int race_id) {
|
void QuestManager::permarace(int race_id) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
//Makes the client the race specified
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->SetBaseRace(race_id);
|
initiator->SetBaseRace(race_id);
|
||||||
initiator->Save(2);
|
initiator->Save(2);
|
||||||
initiator->Kick("Base race change by QuestManager");
|
initiator->Kick("Base race change by QuestManager");
|
||||||
@ -1172,7 +1181,11 @@ void QuestManager::permarace(int race_id) {
|
|||||||
|
|
||||||
void QuestManager::permagender(int gender_id) {
|
void QuestManager::permagender(int gender_id) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
//Makes the client the gender specified
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->SetBaseGender(gender_id);
|
initiator->SetBaseGender(gender_id);
|
||||||
initiator->Save(2);
|
initiator->Save(2);
|
||||||
initiator->Kick("Base gender change by QuestManager");
|
initiator->Kick("Base gender change by QuestManager");
|
||||||
@ -1180,21 +1193,41 @@ void QuestManager::permagender(int gender_id) {
|
|||||||
|
|
||||||
uint16 QuestManager::scribespells(uint8 max_level, uint8 min_level) {
|
uint16 QuestManager::scribespells(uint8 max_level, uint8 min_level) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return initiator->ScribeSpells(min_level, max_level);
|
return initiator->ScribeSpells(min_level, max_level);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) {
|
uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return initiator->LearnDisciplines(min_level, max_level);
|
return initiator->LearnDisciplines(min_level, max_level);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::unscribespells() {
|
void QuestManager::unscribespells() {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->UnscribeSpellAll();
|
initiator->UnscribeSpellAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::untraindiscs() {
|
void QuestManager::untraindiscs() {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->UntrainDiscAll();
|
initiator->UntrainDiscAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1202,7 +1235,6 @@ void QuestManager::givecash(uint32 copper, uint32 silver, uint32 gold, uint32 pl
|
|||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (
|
if (
|
||||||
initiator &&
|
initiator &&
|
||||||
initiator->IsClient() &&
|
|
||||||
(
|
(
|
||||||
copper ||
|
copper ||
|
||||||
silver ||
|
silver ||
|
||||||
@ -1221,79 +1253,103 @@ void QuestManager::givecash(uint32 copper, uint32 silver, uint32 gold, uint32 pl
|
|||||||
|
|
||||||
void QuestManager::pvp(const char *mode) {
|
void QuestManager::pvp(const char *mode) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (!strcasecmp(mode,"on"))
|
|
||||||
{
|
if (!initiator) {
|
||||||
if (initiator)
|
return;
|
||||||
initiator->SetPVP(true);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
if (initiator)
|
initiator->SetPVP(Strings::ToBool(mode));
|
||||||
initiator->SetPVP(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::movepc(int zone_id, float x, float y, float z, float heading) {
|
void QuestManager::movepc(int zone_id, float x, float y, float z, float heading) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (initiator)
|
|
||||||
initiator->MovePC(zone_id, x, y, z, heading);
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
initiator->MovePC(zone_id, x, y, z, heading);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::gmmove(float x, float y, float z) {
|
void QuestManager::gmmove(float x, float y, float z) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (initiator)
|
|
||||||
initiator->GMMove(x, y, z);
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
initiator->GMMove(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::movegrp(int zoneid, float x, float y, float z) {
|
void QuestManager::movegrp(int zoneid, float x, float y, float z) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (initiator)
|
|
||||||
{
|
if (!initiator) {
|
||||||
Group *g = entity_list.GetGroupByClient(initiator);
|
return;
|
||||||
if (g != nullptr) {
|
}
|
||||||
g->TeleportGroup(owner, zoneid, 0, x, y, z, 0.0f);
|
|
||||||
}
|
if (Group *g = entity_list.GetGroupByClient(initiator)) {
|
||||||
else {
|
g->TeleportGroup(owner, zoneid, 0, x, y, z, 0.0f);
|
||||||
Raid *r = entity_list.GetRaidByClient(initiator);
|
} else {
|
||||||
if (r != nullptr) {
|
if (Raid *r = entity_list.GetRaidByClient(initiator)) {
|
||||||
uint32 gid = r->GetGroup(initiator);
|
const auto group_id = r->GetGroup(initiator);
|
||||||
if (gid >= 0 && gid < 12) {
|
if (EQ::ValueWithin(group_id, 0, MAX_RAID_GROUPS)) {
|
||||||
r->TeleportGroup(owner, zoneid, 0, x, y, z, 0.0f, gid);
|
r->TeleportGroup(owner, zoneid, 0, x, y, z, 0.0f, group_id);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
initiator->MovePC(zoneid, x, y, z, 0.0f);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
initiator->MovePC(zoneid, x, y, z, 0.0f);
|
initiator->MovePC(zoneid, x, y, z, 0.0f);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
initiator->MovePC(zoneid, x, y, z, 0.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::doanim(int animation_id, int animation_speed, bool ackreq, eqFilterType filter) {
|
void QuestManager::doanim(int animation_id, int animation_speed, bool ackreq, eqFilterType filter) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!owner) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
owner->DoAnim(animation_id, animation_speed, ackreq, filter);
|
owner->DoAnim(animation_id, animation_speed, ackreq, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::addskill(int skill_id, int value) {
|
void QuestManager::addskill(int skill_id, int value) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (skill_id < 0 || skill_id > EQ::skills::HIGHEST_SKILL)
|
|
||||||
|
if (!initiator) {
|
||||||
return;
|
return;
|
||||||
if (initiator)
|
}
|
||||||
initiator->AddSkill((EQ::skills::SkillType) skill_id, value);
|
|
||||||
|
if (!EQ::ValueWithin(skill_id, EQ::skills::Skill1HBlunt, EQ::skills::HIGHEST_SKILL)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
initiator->AddSkill((EQ::skills::SkillType) skill_id, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::setlanguage(int skill_id, int value) {
|
void QuestManager::setlanguage(int skill_id, int value) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (initiator)
|
|
||||||
initiator->SetLanguageSkill(skill_id, value);
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
initiator->SetLanguageSkill(skill_id, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::setskill(int skill_id, int value) {
|
void QuestManager::setskill(int skill_id, int value) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (skill_id < 0 || skill_id > EQ::skills::HIGHEST_SKILL)
|
|
||||||
|
if (!initiator) {
|
||||||
return;
|
return;
|
||||||
if (initiator)
|
}
|
||||||
initiator->SetSkill((EQ::skills::SkillType) skill_id, value);
|
|
||||||
|
if (!EQ::ValueWithin(skill_id, EQ::skills::Skill1HBlunt, EQ::skills::HIGHEST_SKILL)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
initiator->SetSkill((EQ::skills::SkillType) skill_id, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::setallskill(int value) {
|
void QuestManager::setallskill(int value) {
|
||||||
@ -1980,21 +2036,41 @@ void QuestManager::toggle_spawn_event(int event_id, bool enable, bool strict, bo
|
|||||||
|
|
||||||
bool QuestManager::has_zone_flag(int zone_id) {
|
bool QuestManager::has_zone_flag(int zone_id) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
return initiator ? initiator->HasZoneFlag(zone_id) : false;
|
|
||||||
|
if (!initiator) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return initiator->HasZoneFlag(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::set_zone_flag(int zone_id) {
|
void QuestManager::set_zone_flag(int zone_id) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->SetZoneFlag(zone_id);
|
initiator->SetZoneFlag(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::clear_zone_flag(int zone_id) {
|
void QuestManager::clear_zone_flag(int zone_id) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->ClearZoneFlag(zone_id);
|
initiator->ClearZoneFlag(zone_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::sethp(int64 hpperc) {
|
void QuestManager::sethp(int64 hpperc) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!owner) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int64 newhp = (owner->GetMaxHP() * (100 - hpperc)) / 100;
|
int64 newhp = (owner->GetMaxHP() * (100 - hpperc)) / 100;
|
||||||
owner->Damage(owner, newhp, SPELL_UNKNOWN, EQ::skills::SkillHandtoHand, false, 0, false);
|
owner->Damage(owner, newhp, SPELL_UNKNOWN, EQ::skills::SkillHandtoHand, false, 0, false);
|
||||||
}
|
}
|
||||||
@ -2111,171 +2187,260 @@ bool QuestManager::isdooropen(uint32 doorid) {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::npcrace(int race_id)
|
void QuestManager::npcrace(int race_id)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!owner) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
owner->SendIllusionPacket(race_id);
|
owner->SendIllusionPacket(race_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::npcgender(int gender_id)
|
void QuestManager::npcgender(int gender_id)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!owner) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
owner->SendIllusionPacket(owner->GetRace(), gender_id);
|
owner->SendIllusionPacket(owner->GetRace(), gender_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::npcsize(int newsize)
|
void QuestManager::npcsize(int newsize)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!owner) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
owner->ChangeSize(newsize, true);
|
owner->ChangeSize(newsize, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::npctexture(int newtexture)
|
void QuestManager::npctexture(int newtexture)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!owner) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
owner->SendIllusionPacket(owner->GetRace(), 0xFF, newtexture);
|
owner->SendIllusionPacket(owner->GetRace(), 0xFF, newtexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::playerrace(int race_id)
|
void QuestManager::playerrace(int race_id)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->SendIllusionPacket(race_id);
|
initiator->SendIllusionPacket(race_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::playergender(int gender_id)
|
void QuestManager::playergender(int gender_id)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->SendIllusionPacket(initiator->GetRace(), gender_id);
|
initiator->SendIllusionPacket(initiator->GetRace(), gender_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::playersize(int newsize)
|
void QuestManager::playersize(int newsize)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->ChangeSize(newsize, true);
|
initiator->ChangeSize(newsize, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::playertexture(int newtexture)
|
void QuestManager::playertexture(int newtexture)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->SendIllusionPacket(initiator->GetRace(), 0xFF, newtexture);
|
initiator->SendIllusionPacket(initiator->GetRace(), 0xFF, newtexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::playerfeature(const char* feature, int setting)
|
void QuestManager::playerfeature(const char* feature, int setting)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
uint16 Race = initiator->GetRace();
|
|
||||||
uint8 Gender = initiator->GetGender();
|
|
||||||
uint8 Texture = 0xFF;
|
|
||||||
uint8 HelmTexture = 0xFF;
|
|
||||||
uint8 HairColor = initiator->GetHairColor();
|
|
||||||
uint8 BeardColor = initiator->GetBeardColor();
|
|
||||||
uint8 EyeColor1 = initiator->GetEyeColor1();
|
|
||||||
uint8 EyeColor2 = initiator->GetEyeColor2();
|
|
||||||
uint8 HairStyle = initiator->GetHairStyle();
|
|
||||||
uint8 LuclinFace = initiator->GetLuclinFace();
|
|
||||||
uint8 Beard = initiator->GetBeard();
|
|
||||||
uint32 DrakkinHeritage = initiator->GetDrakkinHeritage();
|
|
||||||
uint32 DrakkinTattoo = initiator->GetDrakkinTattoo();
|
|
||||||
uint32 DrakkinDetails = initiator->GetDrakkinDetails();
|
|
||||||
float Size = initiator->GetSize();
|
|
||||||
|
|
||||||
if (!strcasecmp(feature,"race"))
|
if (!initiator) {
|
||||||
Race = setting;
|
|
||||||
else if (!strcasecmp(feature,"gender"))
|
|
||||||
Gender = setting;
|
|
||||||
else if (!strcasecmp(feature,"texture"))
|
|
||||||
Texture = setting;
|
|
||||||
else if (!strcasecmp(feature,"helm"))
|
|
||||||
HelmTexture = setting;
|
|
||||||
else if (!strcasecmp(feature,"haircolor"))
|
|
||||||
HairColor = setting;
|
|
||||||
else if (!strcasecmp(feature,"beardcolor"))
|
|
||||||
BeardColor = setting;
|
|
||||||
else if (!strcasecmp(feature,"eyecolor1"))
|
|
||||||
EyeColor1 = setting;
|
|
||||||
else if (!strcasecmp(feature,"eyecolor2"))
|
|
||||||
EyeColor2 = setting;
|
|
||||||
else if (!strcasecmp(feature,"hair"))
|
|
||||||
HairStyle = setting;
|
|
||||||
else if (!strcasecmp(feature,"face"))
|
|
||||||
LuclinFace = setting;
|
|
||||||
else if (!strcasecmp(feature,"beard"))
|
|
||||||
Beard = setting;
|
|
||||||
else if (!strcasecmp(feature,"heritage"))
|
|
||||||
DrakkinHeritage = setting;
|
|
||||||
else if (!strcasecmp(feature,"tattoo"))
|
|
||||||
DrakkinTattoo = setting;
|
|
||||||
else if (!strcasecmp(feature,"details"))
|
|
||||||
DrakkinDetails = setting;
|
|
||||||
else if (!strcasecmp(feature,"size"))
|
|
||||||
Size = (float)setting / 10; //dividing by 10 to allow 1 decimal place for adjusting size
|
|
||||||
else
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->SendIllusionPacket(Race, Gender, Texture, HelmTexture, HairColor, BeardColor,
|
uint16 Race = initiator->GetRace();
|
||||||
EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF,
|
uint8 Gender = initiator->GetGender();
|
||||||
DrakkinHeritage, DrakkinTattoo, DrakkinDetails, Size);
|
uint8 Texture = 0xFF;
|
||||||
|
uint8 HelmTexture = 0xFF;
|
||||||
|
uint8 HairColor = initiator->GetHairColor();
|
||||||
|
uint8 BeardColor = initiator->GetBeardColor();
|
||||||
|
uint8 EyeColor1 = initiator->GetEyeColor1();
|
||||||
|
uint8 EyeColor2 = initiator->GetEyeColor2();
|
||||||
|
uint8 HairStyle = initiator->GetHairStyle();
|
||||||
|
uint8 LuclinFace = initiator->GetLuclinFace();
|
||||||
|
uint8 Beard = initiator->GetBeard();
|
||||||
|
uint32 DrakkinHeritage = initiator->GetDrakkinHeritage();
|
||||||
|
uint32 DrakkinTattoo = initiator->GetDrakkinTattoo();
|
||||||
|
uint32 DrakkinDetails = initiator->GetDrakkinDetails();
|
||||||
|
float Size = initiator->GetSize();
|
||||||
|
|
||||||
|
if (!strcasecmp(feature, "race")) {
|
||||||
|
Race = setting;
|
||||||
|
} else if (!strcasecmp(feature, "gender")) {
|
||||||
|
Gender = setting;
|
||||||
|
} else if (!strcasecmp(feature, "texture")) {
|
||||||
|
Texture = setting;
|
||||||
|
} else if (!strcasecmp(feature, "helm")) {
|
||||||
|
HelmTexture = setting;
|
||||||
|
} else if (!strcasecmp(feature, "haircolor")) {
|
||||||
|
HairColor = setting;
|
||||||
|
} else if (!strcasecmp(feature, "beardcolor")) {
|
||||||
|
BeardColor = setting;
|
||||||
|
} else if (!strcasecmp(feature, "eyecolor1")) {
|
||||||
|
EyeColor1 = setting;
|
||||||
|
} else if (!strcasecmp(feature, "eyecolor2")) {
|
||||||
|
EyeColor2 = setting;
|
||||||
|
} else if (!strcasecmp(feature, "hair")) {
|
||||||
|
HairStyle = setting;
|
||||||
|
} else if (!strcasecmp(feature, "face")) {
|
||||||
|
LuclinFace = setting;
|
||||||
|
} else if (!strcasecmp(feature, "beard")) {
|
||||||
|
Beard = setting;
|
||||||
|
} else if (!strcasecmp(feature, "heritage")) {
|
||||||
|
DrakkinHeritage = setting;
|
||||||
|
} else if (!strcasecmp(feature, "tattoo")) {
|
||||||
|
DrakkinTattoo = setting;
|
||||||
|
} else if (!strcasecmp(feature, "details")) {
|
||||||
|
DrakkinDetails = setting;
|
||||||
|
} else if (!strcasecmp(feature, "size")) {
|
||||||
|
Size = (float) setting / 10; //dividing by 10 to allow 1 decimal place for adjusting size
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
initiator->SendIllusionPacket(
|
||||||
|
Race,
|
||||||
|
Gender,
|
||||||
|
Texture,
|
||||||
|
HelmTexture,
|
||||||
|
HairColor,
|
||||||
|
BeardColor,
|
||||||
|
EyeColor1,
|
||||||
|
EyeColor2,
|
||||||
|
HairStyle,
|
||||||
|
LuclinFace,
|
||||||
|
Beard,
|
||||||
|
0xFF,
|
||||||
|
DrakkinHeritage,
|
||||||
|
DrakkinTattoo,
|
||||||
|
DrakkinDetails,
|
||||||
|
Size
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::npcfeature(const char* feature, int setting)
|
void QuestManager::npcfeature(const char* feature, int setting)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
uint16 Race = owner->GetRace();
|
|
||||||
uint8 Gender = owner->GetGender();
|
|
||||||
uint8 Texture = owner->GetTexture();
|
|
||||||
uint8 HelmTexture = owner->GetHelmTexture();
|
|
||||||
uint8 HairColor = owner->GetHairColor();
|
|
||||||
uint8 BeardColor = owner->GetBeardColor();
|
|
||||||
uint8 EyeColor1 = owner->GetEyeColor1();
|
|
||||||
uint8 EyeColor2 = owner->GetEyeColor2();
|
|
||||||
uint8 HairStyle = owner->GetHairStyle();
|
|
||||||
uint8 LuclinFace = owner->GetLuclinFace();
|
|
||||||
uint8 Beard = owner->GetBeard();
|
|
||||||
uint32 DrakkinHeritage = owner->GetDrakkinHeritage();
|
|
||||||
uint32 DrakkinTattoo = owner->GetDrakkinTattoo();
|
|
||||||
uint32 DrakkinDetails = owner->GetDrakkinDetails();
|
|
||||||
float Size = owner->GetSize();
|
|
||||||
|
|
||||||
if (!strcasecmp(feature,"race"))
|
if (!owner) {
|
||||||
Race = setting;
|
|
||||||
else if (!strcasecmp(feature,"gender"))
|
|
||||||
Gender = setting;
|
|
||||||
else if (!strcasecmp(feature,"texture"))
|
|
||||||
Texture = setting;
|
|
||||||
else if (!strcasecmp(feature,"helm"))
|
|
||||||
HelmTexture = setting;
|
|
||||||
else if (!strcasecmp(feature,"haircolor"))
|
|
||||||
HairColor = setting;
|
|
||||||
else if (!strcasecmp(feature,"beardcolor"))
|
|
||||||
BeardColor = setting;
|
|
||||||
else if (!strcasecmp(feature,"eyecolor1"))
|
|
||||||
EyeColor1 = setting;
|
|
||||||
else if (!strcasecmp(feature,"eyecolor2"))
|
|
||||||
EyeColor2 = setting;
|
|
||||||
else if (!strcasecmp(feature,"hair"))
|
|
||||||
HairStyle = setting;
|
|
||||||
else if (!strcasecmp(feature,"face"))
|
|
||||||
LuclinFace = setting;
|
|
||||||
else if (!strcasecmp(feature,"beard"))
|
|
||||||
Beard = setting;
|
|
||||||
else if (!strcasecmp(feature,"heritage"))
|
|
||||||
DrakkinHeritage = setting;
|
|
||||||
else if (!strcasecmp(feature,"tattoo"))
|
|
||||||
DrakkinTattoo = setting;
|
|
||||||
else if (!strcasecmp(feature,"details"))
|
|
||||||
DrakkinDetails = setting;
|
|
||||||
else if (!strcasecmp(feature,"size"))
|
|
||||||
Size = (float)setting / 10; //dividing by 10 to allow 1 decimal place for adjusting size
|
|
||||||
else
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
owner->SendIllusionPacket(Race, Gender, Texture, HelmTexture, HairColor, BeardColor,
|
uint16 Race = owner->GetRace();
|
||||||
EyeColor1, EyeColor2, HairStyle, LuclinFace, Beard, 0xFF,
|
uint8 Gender = owner->GetGender();
|
||||||
DrakkinHeritage, DrakkinTattoo, DrakkinDetails, Size);
|
uint8 Texture = owner->GetTexture();
|
||||||
|
uint8 HelmTexture = owner->GetHelmTexture();
|
||||||
|
uint8 HairColor = owner->GetHairColor();
|
||||||
|
uint8 BeardColor = owner->GetBeardColor();
|
||||||
|
uint8 EyeColor1 = owner->GetEyeColor1();
|
||||||
|
uint8 EyeColor2 = owner->GetEyeColor2();
|
||||||
|
uint8 HairStyle = owner->GetHairStyle();
|
||||||
|
uint8 LuclinFace = owner->GetLuclinFace();
|
||||||
|
uint8 Beard = owner->GetBeard();
|
||||||
|
uint32 DrakkinHeritage = owner->GetDrakkinHeritage();
|
||||||
|
uint32 DrakkinTattoo = owner->GetDrakkinTattoo();
|
||||||
|
uint32 DrakkinDetails = owner->GetDrakkinDetails();
|
||||||
|
float Size = owner->GetSize();
|
||||||
|
|
||||||
|
if (!strcasecmp(feature, "race")) {
|
||||||
|
Race = setting;
|
||||||
|
} else if (!strcasecmp(feature, "gender")) {
|
||||||
|
Gender = setting;
|
||||||
|
} else if (!strcasecmp(feature, "texture")) {
|
||||||
|
Texture = setting;
|
||||||
|
} else if (!strcasecmp(feature, "helm")) {
|
||||||
|
HelmTexture = setting;
|
||||||
|
} else if (!strcasecmp(feature, "haircolor")) {
|
||||||
|
HairColor = setting;
|
||||||
|
} else if (!strcasecmp(feature, "beardcolor")) {
|
||||||
|
BeardColor = setting;
|
||||||
|
} else if (!strcasecmp(feature, "eyecolor1")) {
|
||||||
|
EyeColor1 = setting;
|
||||||
|
} else if (!strcasecmp(feature, "eyecolor2")) {
|
||||||
|
EyeColor2 = setting;
|
||||||
|
} else if (!strcasecmp(feature, "hair")) {
|
||||||
|
HairStyle = setting;
|
||||||
|
} else if (!strcasecmp(feature, "face")) {
|
||||||
|
LuclinFace = setting;
|
||||||
|
} else if (!strcasecmp(feature, "beard")) {
|
||||||
|
Beard = setting;
|
||||||
|
} else if (!strcasecmp(feature, "heritage")) {
|
||||||
|
DrakkinHeritage = setting;
|
||||||
|
} else if (!strcasecmp(feature, "tattoo")) {
|
||||||
|
DrakkinTattoo = setting;
|
||||||
|
} else if (!strcasecmp(feature, "details")) {
|
||||||
|
DrakkinDetails = setting;
|
||||||
|
} else if (!strcasecmp(feature, "size")) {
|
||||||
|
Size = (float) setting / 10; //dividing by 10 to allow 1 decimal place for adjusting size
|
||||||
|
} else {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
owner->SendIllusionPacket(
|
||||||
|
Race,
|
||||||
|
Gender,
|
||||||
|
Texture,
|
||||||
|
HelmTexture,
|
||||||
|
HairColor,
|
||||||
|
BeardColor,
|
||||||
|
EyeColor1,
|
||||||
|
EyeColor2,
|
||||||
|
HairStyle,
|
||||||
|
LuclinFace,
|
||||||
|
Beard,
|
||||||
|
0xFF,
|
||||||
|
DrakkinHeritage,
|
||||||
|
DrakkinTattoo,
|
||||||
|
DrakkinDetails,
|
||||||
|
Size
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::popup(const char *title, const char *text, uint32 popupid, uint32 buttons, uint32 Duration)
|
void QuestManager::popup(const char *title, const char *text, uint32 popupid, uint32 buttons, uint32 Duration)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if(initiator)
|
|
||||||
initiator->SendPopupToClient(title, text, popupid, buttons, Duration);
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
initiator->SendPopupToClient(title, text, popupid, buttons, Duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
int QuestManager::createbotcount(uint8 class_id) {
|
int QuestManager::createbotcount(uint8 class_id) {
|
||||||
@ -2753,47 +2918,40 @@ void QuestManager::whisper(const char *message) {
|
|||||||
int QuestManager::getlevel(uint8 type)
|
int QuestManager::getlevel(uint8 type)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if (type == 0)
|
|
||||||
{
|
if (!initiator) {
|
||||||
return (initiator->GetLevel());
|
|
||||||
}
|
|
||||||
else if(type == 1)
|
|
||||||
{
|
|
||||||
Group *g = entity_list.GetGroupByClient(initiator);
|
|
||||||
if (g != nullptr)
|
|
||||||
return (g->GetAvgLevel());
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else if(type == 2)
|
|
||||||
{
|
|
||||||
Raid *r = entity_list.GetRaidByClient(initiator);
|
|
||||||
if (r != nullptr)
|
|
||||||
return (r->GetAvgLevel());
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else if(type == 3)
|
|
||||||
{
|
|
||||||
Raid *r = entity_list.GetRaidByClient(initiator);
|
|
||||||
if(r != nullptr)
|
|
||||||
{
|
|
||||||
return (r->GetAvgLevel());
|
|
||||||
}
|
|
||||||
Group *g = entity_list.GetGroupByClient(initiator);
|
|
||||||
if(g != nullptr)
|
|
||||||
{
|
|
||||||
return (g->GetAvgLevel());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return (initiator->GetLevel());
|
|
||||||
}
|
|
||||||
else if(type == 4)
|
|
||||||
{
|
|
||||||
return (initiator->CastToClient()->GetLevel2());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == 0) {
|
||||||
|
return initiator->GetLevel();
|
||||||
|
} else if (type == 1) {
|
||||||
|
if (Group *g = entity_list.GetGroupByClient(initiator)) {
|
||||||
|
return g->GetAvgLevel();
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
} else if (type == 2) {
|
||||||
|
if (Raid *r = entity_list.GetRaidByClient(initiator)) {
|
||||||
|
return r->GetAvgLevel();
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
} else if (type == 3) {
|
||||||
|
if (Raid *r = entity_list.GetRaidByClient(initiator)) {
|
||||||
|
return r->GetAvgLevel();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Group *g = entity_list.GetGroupByClient(initiator)) {
|
||||||
|
return g->GetAvgLevel();
|
||||||
|
} else {
|
||||||
|
return initiator->GetLevel();
|
||||||
|
}
|
||||||
|
} else if (type == 4) {
|
||||||
|
return initiator->CastToClient()->GetLevel2();
|
||||||
|
} else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint16 QuestManager::CreateGroundObject(uint32 itemid, const glm::vec4& position, uint32 decay_time)
|
uint16 QuestManager::CreateGroundObject(uint32 itemid, const glm::vec4& position, uint32 decay_time)
|
||||||
@ -2818,36 +2976,33 @@ void QuestManager::ModifyNPCStat(std::string stat, std::string value)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int QuestManager::collectitems_processSlot(int16 slot_id, uint32 item_id,
|
int QuestManager::collectitems_processSlot(
|
||||||
bool remove)
|
int16 slot_id,
|
||||||
{
|
uint32 item_id,
|
||||||
|
bool remove
|
||||||
|
) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
EQ::ItemInstance *item = nullptr;
|
|
||||||
int quantity = 0;
|
|
||||||
|
|
||||||
item = initiator->GetInv().GetItem(slot_id);
|
if (!initiator) {
|
||||||
|
return 0;
|
||||||
// If we have found matching item, add quantity
|
|
||||||
if (item && item->GetID() == item_id)
|
|
||||||
{
|
|
||||||
// If item is stackable, add its charges (quantity)
|
|
||||||
if (item->IsStackable())
|
|
||||||
{
|
|
||||||
quantity = item->GetCharges();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
quantity = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove item from inventory
|
|
||||||
if (remove)
|
|
||||||
{
|
|
||||||
initiator->DeleteItemInInventory(slot_id, 0, true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return quantity;
|
const auto item = initiator->GetInv().GetItem(slot_id);
|
||||||
|
|
||||||
|
// If we have found matching item, add quantity
|
||||||
|
if (item && item->GetID() == item_id) {
|
||||||
|
// If item is stackable, add its charges (quantity)
|
||||||
|
const auto quantity = item->IsStackable() ? item->GetCharges() : 1;
|
||||||
|
|
||||||
|
// Remove item from inventory
|
||||||
|
if (remove) {
|
||||||
|
initiator->DeleteItemInInventory(slot_id, 0, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns number of item_id that exist in inventory
|
// Returns number of item_id that exist in inventory
|
||||||
@ -2857,13 +3012,11 @@ int QuestManager::collectitems(uint32 item_id, bool remove)
|
|||||||
int quantity = 0;
|
int quantity = 0;
|
||||||
int slot_id;
|
int slot_id;
|
||||||
|
|
||||||
for (slot_id = EQ::invslot::GENERAL_BEGIN; slot_id <= EQ::invslot::GENERAL_END; ++slot_id)
|
for (slot_id = EQ::invslot::GENERAL_BEGIN; slot_id <= EQ::invslot::GENERAL_END; ++slot_id) {
|
||||||
{
|
|
||||||
quantity += collectitems_processSlot(slot_id, item_id, remove);
|
quantity += collectitems_processSlot(slot_id, item_id, remove);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (slot_id = EQ::invbag::GENERAL_BAGS_BEGIN; slot_id <= EQ::invbag::GENERAL_BAGS_END; ++slot_id)
|
for (slot_id = EQ::invbag::GENERAL_BAGS_BEGIN; slot_id <= EQ::invbag::GENERAL_BAGS_END; ++slot_id) {
|
||||||
{
|
|
||||||
quantity += collectitems_processSlot(slot_id, item_id, remove);
|
quantity += collectitems_processSlot(slot_id, item_id, remove);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2872,11 +3025,21 @@ int QuestManager::collectitems(uint32 item_id, bool remove)
|
|||||||
|
|
||||||
int QuestManager::countitem(uint32 item_id) {
|
int QuestManager::countitem(uint32 item_id) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return initiator->CountItem(item_id);
|
return initiator->CountItem(item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::removeitem(uint32 item_id, uint32 quantity) {
|
void QuestManager::removeitem(uint32 item_id, uint32 quantity) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->RemoveItem(item_id, quantity);
|
initiator->RemoveItem(item_id, quantity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3321,9 +3484,17 @@ uint8 QuestManager::FactionValue()
|
|||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
FACTION_VALUE oldfac;
|
FACTION_VALUE oldfac;
|
||||||
uint8 newfac = 0;
|
uint8 newfac = 0;
|
||||||
if(initiator && owner->IsNPC()) {
|
if (initiator && owner && owner->IsNPC()) {
|
||||||
oldfac = initiator->GetFactionLevel(initiator->GetID(), owner->GetID(), initiator->GetFactionRace(), initiator->GetClass(), initiator->GetDeity(), owner->GetPrimaryFaction(), owner);
|
oldfac = initiator->GetFactionLevel(
|
||||||
|
initiator->GetID(),
|
||||||
|
owner->GetID(),
|
||||||
|
initiator->GetFactionRace(),
|
||||||
|
initiator->GetClass(),
|
||||||
|
initiator->GetDeity(),
|
||||||
|
owner->GetPrimaryFaction(),
|
||||||
|
owner
|
||||||
|
);
|
||||||
|
|
||||||
// now, reorder the faction to have it make sense (higher values are better)
|
// now, reorder the faction to have it make sense (higher values are better)
|
||||||
switch (oldfac) {
|
switch (oldfac) {
|
||||||
@ -3362,62 +3533,76 @@ uint8 QuestManager::FactionValue()
|
|||||||
|
|
||||||
void QuestManager::enabletitle(int titleset) {
|
void QuestManager::enabletitle(int titleset) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->EnableTitle(titleset);
|
initiator->EnableTitle(titleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QuestManager::checktitle(int titleset) {
|
bool QuestManager::checktitle(int titleset) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
return initiator ? initiator->CheckTitle(titleset) : false;
|
|
||||||
|
if (!initiator) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return initiator->CheckTitle(titleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::removetitle(int titleset) {
|
void QuestManager::removetitle(int titleset) {
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
|
|
||||||
|
if (!initiator) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
initiator->RemoveTitle(titleset);
|
initiator->RemoveTitle(titleset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::wearchange(uint8 slot, uint16 texture, uint32 hero_forge_model /*= 0*/, uint32 elite_material /*= 0*/)
|
void QuestManager::wearchange(uint8 slot, uint16 texture, uint32 hero_forge_model /*= 0*/, uint32 elite_material /*= 0*/)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if(owner){
|
|
||||||
owner->SendTextureWC(slot, texture, hero_forge_model, elite_material);
|
if (!owner) {
|
||||||
if(owner->IsNPC()) {
|
return;
|
||||||
owner->CastToNPC()->NPCSlotTexture(slot, texture);
|
}
|
||||||
}
|
|
||||||
|
owner->SendTextureWC(slot, texture, hero_forge_model, elite_material);
|
||||||
|
if (owner->IsNPC()) {
|
||||||
|
owner->CastToNPC()->NPCSlotTexture(slot, texture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::voicetell(const char *str, int macronum, int racenum, int gendernum)
|
void QuestManager::voicetell(const char *str, int macronum, int racenum, int gendernum)
|
||||||
{
|
{
|
||||||
QuestManagerCurrentQuestVars();
|
QuestManagerCurrentQuestVars();
|
||||||
if(owner && str)
|
|
||||||
{
|
if (!owner) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (str) {
|
||||||
Client *c = entity_list.GetClientByName(str);
|
Client *c = entity_list.GetClientByName(str);
|
||||||
|
|
||||||
if(c)
|
if (c) {
|
||||||
{
|
|
||||||
auto outapp = new EQApplicationPacket(OP_VoiceMacroOut, sizeof(VoiceMacroOut_Struct));
|
auto outapp = new EQApplicationPacket(OP_VoiceMacroOut, sizeof(VoiceMacroOut_Struct));
|
||||||
|
auto* vmo = (VoiceMacroOut_Struct *) outapp->pBuffer;
|
||||||
VoiceMacroOut_Struct* vmo = (VoiceMacroOut_Struct*)outapp->pBuffer;
|
|
||||||
|
|
||||||
strn0cpy(vmo->From, owner->GetCleanName(), sizeof(vmo->From));
|
strn0cpy(vmo->From, owner->GetCleanName(), sizeof(vmo->From));
|
||||||
|
vmo->Type = 1;
|
||||||
vmo->Type = 1;
|
vmo->Voice = (racenum * 2) + gendernum;
|
||||||
|
|
||||||
vmo->Voice = (racenum * 2) + gendernum;
|
|
||||||
|
|
||||||
vmo->MacroNumber = macronum;
|
vmo->MacroNumber = macronum;
|
||||||
|
|
||||||
c->QueuePacket(outapp);
|
c->QueuePacket(outapp);
|
||||||
|
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
LogQuests("from [{}]. Client [{}] not found", owner->GetName(), str);
|
LogQuests("from [{}]. Client [{}] not found", owner->GetName(), str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::SendMail(const char *to, const char *from, const char *subject, const char *message) {
|
void QuestManager::SendMail(const char *to, const char *from, const char *subject, const char *message) {
|
||||||
if(to == nullptr || from == nullptr || subject == nullptr || message == nullptr) {
|
if (!to || !from || !subject || !message) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user