Merge remote-tracking branch 'upstream/master' into spa382update2

This commit is contained in:
KayenEQ 2021-10-01 14:26:43 -04:00
commit d22f9ee294
22 changed files with 134 additions and 55 deletions

View File

@ -384,7 +384,9 @@ struct NewZone_Struct {
/*0716*/ uint32 FastRegenEndurance;
/*0720*/ uint32 NPCAggroMaxDist;
/*0724*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, if this value is 0, it prevents you from running off edges that would end up underworld
/*0728*/
/*0728*/ uint32 LavaDamage; // Seen 50
/*0732*/ uint32 MinLavaDamage; // Seen 10
/*0736*/
};
/*

View File

@ -1863,8 +1863,8 @@ namespace RoF
/*fill in some unknowns with observed values, hopefully it will help */
eq->unknown800 = -1;
eq->unknown844 = 600;
eq->unknown880 = 50;
eq->unknown884 = 10;
OUT(LavaDamage);
OUT(MinLavaDamage);
eq->unknown888 = 1;
eq->unknown889 = 0;
eq->unknown890 = 1;

View File

@ -1919,8 +1919,8 @@ namespace RoF2
eq->SkyRelated2 = -1;
eq->NPCAggroMaxDist = 600;
eq->FilterID = 2008; // Guild Lobby observed value
eq->LavaDamage = 50;
eq->MinLavaDamage = 10;
OUT(LavaDamage);
OUT(MinLavaDamage);
eq->bDisallowManaStone = 1;
eq->bNoBind = 0;
eq->bNoAttack = 0;

View File

@ -581,8 +581,8 @@ struct NewZone_Struct {
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
/*0872*/ uint32 scriptIDSomething3;
/*0876*/ uint32 SuspendBuffs;
/*0880*/ uint32 unknown880; // Seen 50
/*0884*/ uint32 unknown884; // Seen 10
/*0880*/ uint32 LavaDamage; // Seen 50
/*0884*/ uint32 MinLavaDamage; // Seen 10
/*0888*/ uint8 unknown888; // Seen 1
/*0889*/ uint8 unknown889; // Seen 0 (POK) or 1 (rujj)
/*0890*/ uint8 unknown890; // Seen 1

View File

@ -1388,8 +1388,8 @@ namespace SoD
/*fill in some unknowns with observed values, hopefully it will help */
eq->unknown800 = -1;
eq->unknown844 = 600;
eq->unknown880 = 50;
eq->unknown884 = 10;
OUT(LavaDamage);
OUT(MinLavaDamage);
eq->unknown888 = 1;
eq->unknown889 = 0;
eq->unknown890 = 1;

View File

@ -450,8 +450,8 @@ struct NewZone_Struct {
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
/*0872*/ uint32 scriptIDSomething3;
/*0876*/ uint32 SuspendBuffs;
/*0880*/ uint32 unknown880; //seen 50
/*0884*/ uint32 unknown884; //seen 10
/*0880*/ uint32 LavaDamage; //seen 50
/*0884*/ uint32 MinLavaDamage; //seen 10
/*0888*/ uint8 unknown888; //seen 1
/*0889*/ uint8 unknown889; //seen 0 (POK) or 1 (rujj)
/*0890*/ uint8 unknown890; //seen 1

View File

@ -1066,8 +1066,8 @@ namespace SoF
/*fill in some unknowns with observed values, hopefully it will help */
eq->unknown796 = -1;
eq->unknown840 = 600;
eq->unknown876 = 50;
eq->unknown880 = 10;
OUT(LavaDamage);
OUT(MinLavaDamage);
eq->unknown884 = 1;
eq->unknown885 = 0;
eq->unknown886 = 1;

View File

@ -454,8 +454,8 @@ struct NewZone_Struct {
/*0864*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
/*0868*/ uint32 scriptIDSomething3;
/*0872*/ uint32 SuspendBuffs;
/*0876*/ uint32 unknown876; //seen 50
/*0880*/ uint32 unknown880; //seen 10
/*0876*/ uint32 LavaDamage; //seen 50
/*0880*/ uint32 MinLavaDamage; //seen 10
/*0884*/ uint8 unknown884; //seen 1
/*0885*/ uint8 unknown885; //seen 0 (POK) or 1 (rujj)
/*0886*/ uint8 unknown886; //seen 1

View File

@ -1614,8 +1614,8 @@ namespace UF
/*fill in some unknowns with observed values, hopefully it will help */
eq->unknown800 = -1;
eq->unknown844 = 600;
eq->unknown880 = 50;
eq->unknown884 = 10;
OUT(LavaDamage);
OUT(MinLavaDamage);
eq->unknown888 = 1;
eq->unknown889 = 0;
eq->unknown890 = 1;

View File

@ -450,8 +450,8 @@ struct NewZone_Struct {
/*0868*/ uint32 underworld_teleport_index; // > 0 teleports w/ zone point index, invalid succors, -1 affects some collisions
/*0872*/ uint32 scriptIDSomething3;
/*0876*/ uint32 SuspendBuffs;
/*0880*/ uint32 unknown880; //seen 50
/*0884*/ uint32 unknown884; //seen 10
/*0880*/ uint32 LavaDamage; //seen 50
/*0884*/ uint32 MinLavaDamage; //seen 10
/*0888*/ uint8 unknown888; //seen 1
/*0889*/ uint8 unknown889; //seen 0 (POK) or 1 (rujj)
/*0890*/ uint8 unknown890; //seen 1

View File

@ -110,6 +110,8 @@ public:
std::string content_flags;
std::string content_flags_disabled;
int underworld_teleport_index;
int lava_damage;
int min_lava_damage;
};
static std::string PrimaryKey()
@ -212,6 +214,8 @@ public:
"content_flags",
"content_flags_disabled",
"underworld_teleport_index",
"lava_damage",
"min_lava_damage",
};
}
@ -339,6 +343,8 @@ public:
entry.content_flags = "";
entry.content_flags_disabled = "";
entry.underworld_teleport_index = 0;
entry.lava_damage = 50;
entry.min_lava_damage = 10;
return entry;
}
@ -466,6 +472,8 @@ public:
entry.content_flags = row[89] ? row[89] : "";
entry.content_flags_disabled = row[90] ? row[90] : "";
entry.underworld_teleport_index = atoi(row[91]);
entry.lava_damage = atoi(row[92]);
entry.min_lava_damage = atoi(row[93]);
return entry;
}
@ -590,6 +598,8 @@ public:
update_values.push_back(columns[89] + " = '" + EscapeString(zone_entry.content_flags) + "'");
update_values.push_back(columns[90] + " = '" + EscapeString(zone_entry.content_flags_disabled) + "'");
update_values.push_back(columns[91] + " = " + std::to_string(zone_entry.underworld_teleport_index));
update_values.push_back(columns[92] + " = " + std::to_string(zone_entry.lava_damage));
update_values.push_back(columns[93] + " = " + std::to_string(zone_entry.min_lava_damage));
auto results = db.QueryDatabase(
fmt::format(
@ -703,6 +713,8 @@ public:
insert_values.push_back("'" + EscapeString(zone_entry.content_flags) + "'");
insert_values.push_back("'" + EscapeString(zone_entry.content_flags_disabled) + "'");
insert_values.push_back(std::to_string(zone_entry.underworld_teleport_index));
insert_values.push_back(std::to_string(zone_entry.lava_damage));
insert_values.push_back(std::to_string(zone_entry.min_lava_damage));
auto results = db.QueryDatabase(
fmt::format(
@ -824,6 +836,8 @@ public:
insert_values.push_back("'" + EscapeString(zone_entry.content_flags) + "'");
insert_values.push_back("'" + EscapeString(zone_entry.content_flags_disabled) + "'");
insert_values.push_back(std::to_string(zone_entry.underworld_teleport_index));
insert_values.push_back(std::to_string(zone_entry.lava_damage));
insert_values.push_back(std::to_string(zone_entry.min_lava_damage));
insert_chunks.push_back("(" + implode(",", insert_values) + ")");
}
@ -949,6 +963,8 @@ public:
entry.content_flags = row[89] ? row[89] : "";
entry.content_flags_disabled = row[90] ? row[90] : "";
entry.underworld_teleport_index = atoi(row[91]);
entry.lava_damage = atoi(row[92]);
entry.min_lava_damage = atoi(row[93]);
all_entries.push_back(entry);
}
@ -1065,6 +1081,8 @@ public:
entry.content_flags = row[89] ? row[89] : "";
entry.content_flags_disabled = row[90] ? row[90] : "";
entry.underworld_teleport_index = atoi(row[91]);
entry.lava_damage = atoi(row[92]);
entry.min_lava_damage = atoi(row[93]);
all_entries.push_back(entry);
}

View File

@ -748,7 +748,7 @@ typedef enum {
//#define SE_TransferItem 60 // not used
#define SE_Identify 61 // implemented
//#define SE_ItemID 62 // not used
#define SE_WipeHateList 63 // implemented
#define SE_WipeHateList 63 // implemented, @Memblur, chance to wipe hate list of target, base: pct chance, limit: none, max: ? (not implemented), Note: caster level and CHA add to pct chance
#define SE_SpinTarget 64 // implemented - TO DO: Not sure stun portion is working correctly
#define SE_InfraVision 65 // implemented
#define SE_UltraVision 66 // implemented
@ -927,7 +927,7 @@ typedef enum {
#define SE_FeignedCastOnChance 239 // implemented - ability gives you an increasing chance for your feigned deaths to not be revealed by spells cast upon you.
//#define SE_StringUnbreakable 240 // not used [Likely related to above - you become immune to feign breaking on a resisted spell and have a good chance of feigning through a spell that successfully lands upon you.]
#define SE_ImprovedReclaimEnergy 241 // implemented - increase the amount of mana returned to you when reclaiming your pet.
#define SE_IncreaseChanceMemwipe 242 // implemented - increases the chance to wipe hate with memory blurr
#define SE_IncreaseChanceMemwipe 242 // implemented - @Memblur, increases the chance to wipe hate with memory blurr, base: chance pct, limit: none, max: none, Note: Mods final blur chance after other bonuses added.
#define SE_CharmBreakChance 243 // implemented - Total Domination
#define SE_RootBreakChance 244 // implemented[AA] reduce the chance that your root will break.
#define SE_TrapCircumvention 245 // *not implemented[AA] - decreases the chance that you will set off a trap when opening a chest

View File

@ -34,7 +34,7 @@
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/
#define CURRENT_BINARY_DATABASE_VERSION 9172
#define CURRENT_BINARY_DATABASE_VERSION 9173
#ifdef BOTS
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9028

View File

@ -426,6 +426,7 @@
9170|2021_03_03_instance_safereturns.sql|SHOW TABLES LIKE 'character_instance_safereturns'|empty|
9171|2021_03_30_remove_dz_is_current_member.sql|SHOW COLUMNS FROM `dynamic_zone_members` LIKE 'is_current_member'|not_empty|
9172|2021_05_21_shared_tasks.sql|SHOW TABLES LIKE 'shared_tasks'|empty|
9173|2021_09_14_zone_lava_damage.sql|SHOW COLUMNS FROM `zone` LIKE 'lava_damage'|empty|
# Upgrade conditions:
# This won't be needed after this system is implemented, but it is used database that are not

View File

@ -0,0 +1 @@
ALTER TABLE zone ADD lava_damage INT(11) NULL DEFAULT '50' AFTER underworld_teleport_index, ADD min_lava_damage INT(11) NOT NULL DEFAULT '10' AFTER lava_damage;

View File

@ -12198,7 +12198,8 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app)
tr.name,
tr.trivial,
SUM(tre.componentcount),
tr.tradeskill
tr.tradeskill,
tr.must_learn
FROM
tradeskill_recipe AS tr
LEFT JOIN tradeskill_recipe_entries AS tre ON tr.id = tre.recipe_id
@ -12298,7 +12299,8 @@ void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app)
tr.name,
tr.trivial,
SUM(tre.componentcount),
tr.tradeskill
tr.tradeskill,
tr.must_learn
FROM
tradeskill_recipe AS tr
LEFT JOIN tradeskill_recipe_entries AS tre ON tr.id = tre.recipe_id

View File

@ -846,6 +846,7 @@ public:
bool HarmonySpellLevelCheck(int32 spell_id, Mob* target = nullptr);
bool CanFocusUseRandomEffectivenessByType(focusType type);
int GetFocusRandomEffectivenessValue(int focus_base, int focus_base2, bool best_focus = 0);
int GetMemoryBlurChance(int base_chance);
bool TryDoubleMeleeRoundEffect();
bool GetUseDoubleMeleeRoundDmgBonus() const { return use_double_melee_round_dmg_bonus; }
@ -1534,6 +1535,7 @@ protected:
bool endur_upkeep;
bool degenerating_effects; // true if we have a buff that needs to be recalced every tick
bool spawned_in_water;
public:
bool GetWasSpawnedInWater() const;

View File

@ -63,6 +63,11 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
if (spell.disallow_sit && IsBuffSpell(spell_id) && IsClient() && (CastToClient()->IsSitting() || CastToClient()->GetHorseId() != 0))
return false;
bool CanMemoryBlurFromMez = true;
if (IsMezzed()) { //Check for special memory blur behavior when on mez, this needs to be before buff override.
CanMemoryBlurFromMez = false;
}
bool c_override = false;
if (caster && caster->IsClient() && GetCastedSpellInvSlot() > 0) {
const EQ::ItemInstance *inst = caster->CastToClient()->GetInv().GetItem(GetCastedSpellInvSlot());
@ -1530,16 +1535,16 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial, int level_ove
#ifdef SPELL_EFFECT_SPAM
snprintf(effect_desc, _EDLEN, "Memory Blur: %d", effect_value);
#endif
int wipechance = spells[spell_id].base[i];
int bonus = 0;
if (caster){
bonus = caster->spellbonuses.IncreaseChanceMemwipe +
caster->itembonuses.IncreaseChanceMemwipe +
caster->aabonuses.IncreaseChanceMemwipe;
//Memory blur component of Mez spells is not checked again if Mez is recast on a target that is already mezed
if (!CanMemoryBlurFromMez && IsEffectInSpell(spell_id, SE_Mez)) {
break;
}
int wipechance = 0;
if (caster) {
wipechance = caster->GetMemoryBlurChance(effect_value);
}
wipechance += wipechance*bonus/100;
if(zone->random.Roll(wipechance))
{
@ -3859,19 +3864,15 @@ void Mob::DoBuffTic(const Buffs_Struct &buff, int slot, Mob *caster)
}
case SE_WipeHateList: {
if (IsMezSpell(buff.spellid))
if (IsMezSpell(buff.spellid)) {
break;
int wipechance = spells[buff.spellid].base[i];
int bonus = 0;
if (caster) {
bonus = caster->spellbonuses.IncreaseChanceMemwipe +
caster->itembonuses.IncreaseChanceMemwipe +
caster->aabonuses.IncreaseChanceMemwipe;
}
wipechance += wipechance * bonus / 100;
int wipechance = 0;
if (caster) {
wipechance = caster->GetMemoryBlurChance(effect_value);
}
if (zone->random.Roll(wipechance)) {
if (IsAIControlled()) {
@ -8544,3 +8545,42 @@ bool Mob::NegateSpellEffect(uint16 spell_id, int effect_id)
}
return false;
}
int Mob::GetMemoryBlurChance(int base_chance)
{
/*
Memory Blur mechanic for SPA 62
Chance formula is effect chance + charisma modifer + caster level modifier
Effect chance is base value of spell
Charisma modifier is CHA/10 = %, with MAX of 15% (thus 150 cha gives you max bonus)
Caster level modifier. +100% if caster < level 17 which scales down to 25% at > 53. **
(Yes the above gets worse as you level. Behavior was confirmed on live.)
Memory blur is applied to mez on initial cast using same formula. However, recasting on a target that
is already mezed will not give a chance to memory blur. The blur is not checked on buff ticks.
SPA 242 SE_IncreaseChanceMemwipe modifies the final chance after all bonuses are applied.
This is also applied to memory blur from mez spells.
this = caster
*/
int cha_mod = int(GetCHA() / 10);
cha_mod = std::min(cha_mod, 15);
int lvl_mod = 0;
if (GetLevel() < 17) {
lvl_mod = 100;
}
else if (GetLevel() > 53) {
lvl_mod = 25;
}
else {
lvl_mod = 100 + ((GetLevel() - 16)*-2);//Derived from above range of values.**
}
int chance = cha_mod + lvl_mod + base_chance;
int chance_mod = spellbonuses.IncreaseChanceMemwipe + itembonuses.IncreaseChanceMemwipe + aabonuses.IncreaseChanceMemwipe;
chance += chance * chance_mod / 100;
return chance;
}

View File

@ -3406,7 +3406,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid
buffs[emptyslot].focusproclimit_procamt = 0;
buffs[emptyslot].instrument_mod = caster ? caster->GetInstrumentMod(spell_id) : 10;
if (level_override > 0) {
if (level_override > 0 || buffs[emptyslot].numhits > 0) {
buffs[emptyslot].UpdateClient = true;
} else {
if (buffs[emptyslot].ticsremaining > (1 + CalcBuffDuration_formula(caster_level, spells[spell_id].buffdurationformula, spells[spell_id].buffduration)))

View File

@ -782,7 +782,7 @@ void Client::SendTradeskillSearchResults(
for (auto row = results.begin(); row != results.end(); ++row) {
if (row == nullptr || row[0] == nullptr || row[1] == nullptr || row[2] == nullptr || row[3] == nullptr ||
row[5] == nullptr) {
row[4] == nullptr || row[5] == nullptr) {
continue;
}
@ -790,27 +790,36 @@ void Client::SendTradeskillSearchResults(
const char *name = row[1];
uint32 trivial = (uint32) atoi(row[2]);
uint32 comp_count = (uint32) atoi(row[3]);
uint32 tradeskill = (uint16) atoi(row[5]);
uint32 tradeskill = (uint16) atoi(row[4]);
uint32 must_learn = (uint16) atoi(row[5]);
// Skip the recipes that exceed the threshold in skill difference
// Recipes that have either been made before or were
// explicitly learned are excempt from that limit
auto character_learned_recipe = CharacterRecipeListRepository::GetRecipe(
character_learned_recipe_list,
recipe_id
);
if (RuleB(Skills, UseLimitTradeskillSearchSkillDiff) &&
((int32) trivial - (int32) GetSkill((EQ::skills::SkillType) tradeskill)) >
RuleI(Skills, MaxTradeskillSearchSkillDiff)) {
LogTradeskills("Checking limit recipe_id [{}] name [{}]", recipe_id, name);
auto character_learned_recipe = CharacterRecipeListRepository::GetRecipe(
character_learned_recipe_list,
recipe_id
);
if (character_learned_recipe.made_count == 0) {
continue;
}
}
//Skip recipes that must be learned
if ((must_learn & 0xf) && !character_learned_recipe.recipe_id) {
continue;
}
auto outapp = new EQApplicationPacket(OP_RecipeReply, sizeof(RecipeReply_Struct));
RecipeReply_Struct *reply = (RecipeReply_Struct *) outapp->pBuffer;
@ -1489,7 +1498,7 @@ bool ZoneDatabase::GetTradeRecipe(
recipe_id
);
if (character_learned_recipe.made_count > 0) {
if (character_learned_recipe.recipe_id) { //If this exists we learned it
LogTradeskills("[GetTradeRecipe] made_count [{}]", character_learned_recipe.made_count);
spec->has_learnt = true;

View File

@ -153,7 +153,6 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
LogInfo("Zone Bootup: [{}] ([{}]: [{}])", zonename, iZoneID, iInstanceID);
parse->Init();
UpdateWindowTitle(nullptr);
zone->GetTimeSync();
zone->RequestUCSServerStatus();
@ -1818,7 +1817,8 @@ void Zone::Repop(uint32 delay)
void Zone::GetTimeSync()
{
if (worldserver.Connected() && !zone_has_current_time) {
if (!zone_has_current_time) {
LogInfo("Requesting world time");
auto pack = new ServerPacket(ServerOP_GetWorldTime, 1);
worldserver.SendPacket(pack);
safe_delete(pack);

View File

@ -167,7 +167,9 @@ bool ZoneDatabase::GetZoneCFG(
"fast_regen_endurance, " // 59
"npc_max_aggro_dist, " // 60
"max_movement_update_range, " // 61
"underworld_teleport_index " // 62
"underworld_teleport_index, " // 62
"lava_damage, " // 63
"min_lava_damage " // 64
"FROM zone WHERE zoneidnumber = %i AND version = %i %s",
zoneid,
instance_id,
@ -220,6 +222,8 @@ bool ZoneDatabase::GetZoneCFG(
zone_data->FastRegenEndurance = atoi(row[59]);
zone_data->NPCAggroMaxDist = atoi(row[60]);
zone_data->underworld_teleport_index = atoi(row[62]);
zone_data->LavaDamage = atoi(row[63]);
zone_data->MinLavaDamage = atoi(row[64]);
int bindable = 0;
bindable = atoi(row[31]);