mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 17:38:26 +00:00
[Spells] Illusions will now persist onto the corpse when mob is killed. (#1960)
* illusion applies to corpse * Update spell_effects.cpp * [Spells] Illusions will now persist onto the corpse when mob is killed. addressed comments
This commit is contained in:
+26
-6
@@ -8982,6 +8982,24 @@ void Mob::SendIllusionWearChange(Client* c) {
|
||||
}
|
||||
}
|
||||
|
||||
void Mob::ApplyIllusionToCorpse(int32 spell_id, Corpse* new_corpse) {
|
||||
|
||||
//Transfers most illusions over to the corpse upon death
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!new_corpse) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < EFFECT_COUNT; i++){
|
||||
if (spells[spell_id].effect_id[i] == SE_Illusion) {
|
||||
new_corpse->ApplySpellEffectIllusion(spell_id, nullptr, -1, spells[spell_id].base_value[i], spells[spell_id].limit_value[i], spells[spell_id].max_value[i]);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Mob::ApplySpellEffectIllusion(int32 spell_id, Mob *caster, int buffslot, int base, int limit, int max)
|
||||
{
|
||||
@@ -9091,12 +9109,14 @@ void Mob::ApplySpellEffectIllusion(int32 spell_id, Mob *caster, int buffslot, in
|
||||
SendWearChange(x);
|
||||
}
|
||||
|
||||
if (caster == this && spell_id != SPELL_MINOR_ILLUSION && spell_id != SPELL_ILLUSION_TREE &&
|
||||
(spellbonuses.IllusionPersistence || aabonuses.IllusionPersistence || itembonuses.IllusionPersistence)) {
|
||||
buffs[buffslot].persistant_buff = 1;
|
||||
}
|
||||
else {
|
||||
buffs[buffslot].persistant_buff = 0;
|
||||
if (buffslot != -1) {
|
||||
if (caster == this && spell_id != SPELL_MINOR_ILLUSION && spell_id != SPELL_ILLUSION_TREE &&
|
||||
(spellbonuses.IllusionPersistence || aabonuses.IllusionPersistence || itembonuses.IllusionPersistence)) {
|
||||
buffs[buffslot].persistant_buff = 1;
|
||||
}
|
||||
else {
|
||||
buffs[buffslot].persistant_buff = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user