Merge fix with sql

This commit is contained in:
KimLS
2018-11-25 15:35:52 -08:00
14 changed files with 51 additions and 28 deletions
+12 -1
View File
@@ -1172,7 +1172,7 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) {
return;
//check cooldown
if(!p_timers.Expired(&database, rank->spell_type + pTimerAAStart)) {
if(!p_timers.Expired(&database, rank->spell_type + pTimerAAStart, false)) {
uint32 aaremain = p_timers.GetRemainingTime(rank->spell_type + pTimerAAStart);
uint32 aaremain_hr = aaremain / (60 * 60);
uint32 aaremain_min = (aaremain / 60) % 60;
@@ -1208,6 +1208,17 @@ void Client::ActivateAlternateAdvancementAbility(int rank_id, int target_id) {
if (spells[rank->spell].targettype == ST_Pet || spells[rank->spell].targettype == ST_SummonedPet)
target_id = GetPetID();
// extra handling for cast_not_standing spells
if (!spells[rank->spell].cast_not_standing) {
if (GetAppearance() == eaSitting) // we need to stand!
SetAppearance(eaStanding, false);
if (GetAppearance() != eaStanding) {
Message_StringID(MT_SpellFailure, STAND_TO_CAST);
return;
}
}
// Bards can cast instant cast AAs while they are casting another song
if(spells[rank->spell].cast_time == 0 && GetClass() == BARD && IsBardSong(casting_spell_id)) {
if(!SpellFinished(rank->spell, entity_list.GetMob(target_id), EQEmu::CastingSlot::AltAbility, spells[rank->spell].mana, -1, spells[rank->spell].ResistDiff, false)) {
+1
View File
@@ -3692,6 +3692,7 @@ EXTERN_C XS(boot_quest) {
newXS(strcpy(buf, "GetZoneID"), XS__GetZoneID, file);
newXS(strcpy(buf, "GetZoneLongName"), XS__GetZoneLongName, file);
newXS(strcpy(buf, "get_data"), XS__get_data, file);
newXS(strcpy(buf, "get_data_expires"), XS__get_data_expires, file);
newXS(strcpy(buf, "set_data"), XS__set_data, file);
newXS(strcpy(buf, "delete_data"), XS__delete_data, file);
newXS(strcpy(buf, "IsBeneficialSpell"), XS__IsBeneficialSpell, file);
+1 -1
View File
@@ -62,7 +62,7 @@ void Mob::CheckFlee() {
}
// If no special flee_percent check for Gray or Other con rates
if(GetLevelCon(hate_top->GetLevel(), GetLevel()) == CON_GRAY && fleeratio == 0 && RuleB(Combat, FleeGray)) {
if(GetLevelCon(hate_top->GetLevel(), GetLevel()) == CON_GRAY && fleeratio == 0 && RuleB(Combat, FleeGray) && GetLevel() <= RuleI(Combat, FleeGrayMaxLevel)) {
fleeratio = RuleI(Combat, FleeGrayHPRatio);
} else if(fleeratio == 0) {
fleeratio = RuleI(Combat, FleeHPRatio );
+1
View File
@@ -1680,6 +1680,7 @@ luabind::scope lua_register_general() {
luabind::def("say_link", (std::string(*)(const char*,bool))&lua_say_link),
luabind::def("say_link", (std::string(*)(const char*))&lua_say_link),
luabind::def("get_data", (std::string(*)(std::string))&lua_get_data),
luabind::def("get_data_expires", (std::string(*)(std::string))&lua_get_data_expires),
luabind::def("set_data", (void(*)(std::string, std::string))&lua_set_data),
luabind::def("set_data", (void(*)(std::string, std::string, std::string))&lua_set_data),
luabind::def("delete_data", (bool(*)(std::string))&lua_delete_data),
+1
View File
@@ -418,6 +418,7 @@
#define NO_LONGER_HIDDEN 12337 //You are no longer hidden.
#define STOP_SNEAKING 12338 //You stop sneaking
#define NOT_IN_CONTROL 12368 //You do not have control of yourself right now.
#define STAND_TO_CAST 12441 //You must be standing to cast a spell.
#define ALREADY_CASTING 12442 //You are already casting a spell!
#define SHIMMERS_BRIEFLY 12444 //Your %1 shimmers briefly.
#define SENSE_CORPSE_NOT_NAME 12446 //You don't sense any corpses of that name.
+6 -1
View File
@@ -1295,7 +1295,7 @@ EQEmu::ItemInstance* Client::FindTraderItemBySerialNumber(int32 SerialNumber){
GetItems_Struct* Client::GetTraderItems(){
const EQEmu::ItemInstance* item = nullptr;
uint16 SlotID = 0;
uint16 SlotID = INVALID_INDEX;
auto gis = new GetItems_Struct;
@@ -1304,9 +1304,14 @@ GetItems_Struct* Client::GetTraderItems(){
uint8 ndx = 0;
for (int i = EQEmu::invslot::GENERAL_BEGIN; i <= EQEmu::invslot::GENERAL_END; i++) {
if (ndx >= 80)
break;
item = this->GetInv().GetItem(i);
if(item && item->GetItem()->ID == 17899){ //Traders Satchel
for (int x = EQEmu::invbag::SLOT_BEGIN; x <= EQEmu::invbag::SLOT_END; x++) {
if (ndx >= 80)
break;
SlotID = EQEmu::InventoryProfile::CalcSlotId(i, x);
item = this->GetInv().GetItem(SlotID);
+11 -15
View File
@@ -1864,26 +1864,22 @@ bool Zone::RemoveSpawnGroup(uint32 in_id) {
return false;
}
// Added By Hogie
bool ZoneDatabase::GetDecayTimes(npcDecayTimes_Struct* npcCorpseDecayTimes) {
const std::string query = "SELECT varname, value FROM variables WHERE varname LIKE 'decaytime%%' ORDER BY varname";
bool ZoneDatabase::GetDecayTimes(npcDecayTimes_Struct *npcCorpseDecayTimes)
{
const std::string query =
"SELECT varname, value FROM variables WHERE varname LIKE 'decaytime%%' ORDER BY varname";
auto results = QueryDatabase(query);
if (!results.Success())
return false;
return false;
int index = 0;
for (auto row = results.begin(); row != results.end(); ++row, ++index) {
Seperator sep(row[0]);
npcCorpseDecayTimes[index].minlvl = atoi(sep.arg[1]);
npcCorpseDecayTimes[index].maxlvl = atoi(sep.arg[2]);
for (auto row = results.begin(); row != results.end(); ++row, ++index) {
Seperator sep(row[0]);
npcCorpseDecayTimes[index].minlvl = atoi(sep.arg[1]);
npcCorpseDecayTimes[index].maxlvl = atoi(sep.arg[2]);
if (atoi(row[1]) > 7200)
npcCorpseDecayTimes[index].seconds = 720;
else
npcCorpseDecayTimes[index].seconds = atoi(row[1]);
}
npcCorpseDecayTimes[index].seconds = std::min(24 * 60 * 60, atoi(row[1]));
}
return true;
}
+8 -8
View File
@@ -4358,15 +4358,15 @@ uint32 ZoneDatabase::GetCharacterCorpseCount(uint32 char_id) {
}
uint32 ZoneDatabase::GetCharacterCorpseID(uint32 char_id, uint8 corpse) {
std::string query = StringFormat("SELECT `id` FROM `character_corpses` WHERE `charid` = '%u'", char_id);
auto results = QueryDatabase(query);
std::string query = StringFormat("SELECT `id` FROM `character_corpses` WHERE `charid` = '%u' limit %d, 1", char_id, corpse);
for (auto row = results.begin(); row != results.end(); ++row) {
for (int i = 0; i < corpse; i++) {
return atoul(row[0]);
}
}
return 0;
auto results = QueryDatabase(query);
auto row = results.begin();
if (row != results.end())
return atoul(row[0]);
else
return 0;
}
uint32 ZoneDatabase::GetCharacterCorpseItemCount(uint32 corpse_id){