mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-25 00:12:27 +00:00
[Rules] Add Resurrection Sickness rules for Characters/Bots. (#1692)
* [Rules] Add Resurrection Sickness rule for Characters/Bots. - Add RULE_BOOL(Character, UseResurrectionSickness, true, "Use Resurrection Sickness based on Resurrection spell cast, set to false to disable Resurrection Sickness.") - Add RULE_BOOL(Bots, UseOldRaceRezEffects, false, "Older clients had ID 757 for races with high starting STR, but it doesn't seem used anymore") - Add RULE_BOOL(Bots, UseResurrectionSickness, true, "Use Resurrection Sickness based on Resurrection spell cast, set to false to disable Resurrection Sickness.") * Add rules for spell IDs. * Fix bot health on spawn when resurrection sickness is disabled. - Formatting. * Remove 'this' keyword.
This commit is contained in:
parent
f8cbc2faed
commit
bf92845a4a
@ -168,6 +168,9 @@ RULE_BOOL(Character, EnableCharacterEXPMods, false, "Enables character zone-base
|
|||||||
RULE_BOOL(Character, PVPEnableGuardFactionAssist, true, "Enables faction based assisting against the aggresor in pvp.")
|
RULE_BOOL(Character, PVPEnableGuardFactionAssist, true, "Enables faction based assisting against the aggresor in pvp.")
|
||||||
RULE_BOOL(Character, SkillUpFromItems, true, "Allow Skill ups from clickable items")
|
RULE_BOOL(Character, SkillUpFromItems, true, "Allow Skill ups from clickable items")
|
||||||
RULE_BOOL(Character, EnableTestBuff, false, "Allow the use of /testbuff")
|
RULE_BOOL(Character, EnableTestBuff, false, "Allow the use of /testbuff")
|
||||||
|
RULE_BOOL(Character, UseResurrectionSickness, true, "Use Resurrection Sickness based on Resurrection spell cast, set to false to disable Resurrection Sickness.")
|
||||||
|
RULE_INT(Character, OldResurrectionSicknessSpellID, 757, "757 is Default Old Resurrection Sickness Spell ID")
|
||||||
|
RULE_INT(Character, ResurrectionSicknessSpellID, 756, "756 is Default Resurrection Sickness Spell ID")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Mercs)
|
RULE_CATEGORY(Mercs)
|
||||||
@ -586,6 +589,10 @@ RULE_REAL(Bots, LeashDistance, 562500.0f, "Distance a bot is allowed to travel f
|
|||||||
RULE_BOOL(Bots, AllowApplyPoisonCommand, true, "Allows the use of the bot command 'applypoison'")
|
RULE_BOOL(Bots, AllowApplyPoisonCommand, true, "Allows the use of the bot command 'applypoison'")
|
||||||
RULE_BOOL(Bots, AllowApplyPotionCommand, true, "Allows the use of the bot command 'applypotion'")
|
RULE_BOOL(Bots, AllowApplyPotionCommand, true, "Allows the use of the bot command 'applypotion'")
|
||||||
RULE_BOOL(Bots, RestrictApplyPotionToRogue, true, "Restricts the bot command 'applypotion' to rogue-usable potions (i.e., poisons)")
|
RULE_BOOL(Bots, RestrictApplyPotionToRogue, true, "Restricts the bot command 'applypotion' to rogue-usable potions (i.e., poisons)")
|
||||||
|
RULE_BOOL(Bots, OldRaceRezEffects, false, "Older clients had ID 757 for races with high starting STR, but it doesn't seem used anymore")
|
||||||
|
RULE_BOOL(Bots, ResurrectionSickness, true, "Use Resurrection Sickness based on Resurrection spell cast, set to false to disable Resurrection Sickness.")
|
||||||
|
RULE_INT(Bots, OldResurrectionSicknessSpell, 757, "757 is Default Old Resurrection Sickness Spell")
|
||||||
|
RULE_INT(Bots, ResurrectionSicknessSpell, 756, "756 is Default Resurrection Sickness Spell")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
24
zone/bot.cpp
24
zone/bot.cpp
@ -398,10 +398,26 @@ Bot::Bot(uint32 botID, uint32 botOwnerCharacterID, uint32 botSpellsID, double to
|
|||||||
current_hp = max_hp;
|
current_hp = max_hp;
|
||||||
|
|
||||||
if(current_hp <= 0) {
|
if(current_hp <= 0) {
|
||||||
SetHP(max_hp/5);
|
BuffFadeNonPersistDeath();
|
||||||
SetMana(0);
|
if (RuleB(Bots, ResurrectionSickness)) {
|
||||||
BuffFadeAll();
|
int resurrection_sickness_spell_id = (
|
||||||
SpellOnTarget(756, this); // Rezz effects
|
RuleB(Bots, OldRaceRezEffects) &&
|
||||||
|
(
|
||||||
|
GetRace() == BARBARIAN ||
|
||||||
|
GetRace() == DWARF ||
|
||||||
|
GetRace() == TROLL ||
|
||||||
|
GetRace() == OGRE
|
||||||
|
) ?
|
||||||
|
RuleI(Bots, OldResurrectionSicknessSpell) :
|
||||||
|
RuleI(Bots, ResurrectionSicknessSpell)
|
||||||
|
);
|
||||||
|
SetHP(max_hp / 5);
|
||||||
|
SetMana(0);
|
||||||
|
SpellOnTarget(resurrection_sickness_spell_id, this); // Rezz effects
|
||||||
|
} else {
|
||||||
|
SetHP(GetMaxHP());
|
||||||
|
SetMana(GetMaxMana());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(current_mana > max_mana)
|
if(current_mana > max_mana)
|
||||||
|
|||||||
@ -981,21 +981,28 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I
|
|||||||
this->name, (uint16)spells[SpellID].base_value[0],
|
this->name, (uint16)spells[SpellID].base_value[0],
|
||||||
SpellID, ZoneID, InstanceID);
|
SpellID, ZoneID, InstanceID);
|
||||||
|
|
||||||
this->BuffFadeNonPersistDeath();
|
BuffFadeNonPersistDeath();
|
||||||
int SpellEffectDescNum = GetSpellEffectDescNum(SpellID);
|
int SpellEffectDescNum = GetSpellEffectDescNum(SpellID);
|
||||||
// Rez spells with Rez effects have this DescNum (first is Titanium, second is 6.2 Client)
|
// Rez spells with Rez effects have this DescNum (first is Titanium, second is 6.2 Client)
|
||||||
if((SpellEffectDescNum == 82) || (SpellEffectDescNum == 39067)) {
|
if(RuleB(Character, UseResurrectionSickness) && SpellEffectDescNum == 82 || SpellEffectDescNum == 39067) {
|
||||||
|
SetHP(GetMaxHP() / 5);
|
||||||
SetMana(0);
|
SetMana(0);
|
||||||
SetHP(GetMaxHP()/5);
|
int resurrection_sickness_spell_id = (
|
||||||
int rez_eff = 756;
|
RuleB(Character, UseOldRaceRezEffects) &&
|
||||||
if (RuleB(Character, UseOldRaceRezEffects) &&
|
(
|
||||||
(GetRace() == BARBARIAN || GetRace() == DWARF || GetRace() == TROLL || GetRace() == OGRE))
|
GetRace() == BARBARIAN ||
|
||||||
rez_eff = 757;
|
GetRace() == DWARF ||
|
||||||
SpellOnTarget(rez_eff, this); // Rezz effects
|
GetRace() == TROLL ||
|
||||||
|
GetRace() == OGRE
|
||||||
|
) ?
|
||||||
|
RuleI(Character, OldResurrectionSicknessSpellID) :
|
||||||
|
RuleI(Character, ResurrectionSicknessSpellID)
|
||||||
|
);
|
||||||
|
SpellOnTarget(resurrection_sickness_spell_id, this); // Rezz effects
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SetMana(GetMaxMana());
|
|
||||||
SetHP(GetMaxHP());
|
SetHP(GetMaxHP());
|
||||||
|
SetMana(GetMaxMana());
|
||||||
}
|
}
|
||||||
if(spells[SpellID].base_value[0] < 100 && spells[SpellID].base_value[0] > 0 && PendingRezzXP > 0)
|
if(spells[SpellID].base_value[0] < 100 && spells[SpellID].base_value[0] > 0 && PendingRezzXP > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user