• Страница 1 из 1
  • 1
Архив - только для чтения
Модератор форума: andycrowz  
Нужны патчи ДК 2 спелла
ElfShakil
Христианин
Нужны патчи для mangos на рыцаря смерти ( он же ДК ) на 2 спелла:
Рунический удар
Воскрешение мертвых
Кто найдёт тому +6)
Сообщение # 1 написано 07.07.2010 в 18:51
Recon
~root~
ты скажи что именно не работает в них )

вот на raise dead вроде

this is fix for summons : raise dead, feral spirit, summon gargoyle, dancing rune weapon and anti-magic zone this fix ONLY allow them to spawn, i set their dmg and stats randomly, because the real values are not known yet, they are all considerated as GUARDIANs summons, so they only follow their caster and attack all enemies they see. if you want to add cast to them, use SD2, and about anti-magic zone : when it spawns, it cast the shield, but the shield itself dont work sad (i repair maybe later)
//comment : i like rabits biggrin do you too?
spell.h
Code:

Code
        void EffectKillCredit(uint32 i);
          void EffectQuestFail(uint32 i);
+        void EffectSpecialSummon( uint32 spell_id, uint32 i, Unit* m_caster );

spelleffect.cpp
Code:

Code

void Spell::EffectApplyAura(uint32 i)
{
+    if( m_spellInfo->Id == 46584 && i == 2)//raise dead
+        EffectSpecialSummon( 52150, 0, m_caster );
+    if( m_spellInfo->Id == 49028 && i == 2)//dancing rune weapon
+        EffectSpecialSummon( 49028, 0, m_caster );
+    if( m_spellInfo->Id == 49206)//summon gargoyle
+        EffectSpecialSummon( 49206, 0, m_caster );      
      if(!unitTarget)
          return;

SpellImmuneList const& list = unitTarget->m_spellImmune[IMMUNITY_STATE];
for(SpellImmuneList::const_iterator itr = list.begin(); itr != list.end(); ++itr)

Code:

Code
void Spell::EffectSummonType(uint32 i)
{
+    if( m_spellInfo->Id == 51533)//feral spirit
+    {    //2 spirit wolves
+        EffectSpecialSummon( 51533, 0, m_caster );
+        EffectSpecialSummon( 51533, 0, m_caster );
+        return; //no need to continue
+    }
+    if( m_spellInfo->Id == 51052)//anti-magic zone
+    {
+        EffectSpecialSummon( 51052, 0, m_caster );
+        return; //no need to continue
+    }
      switch(m_spellInfo->EffectMiscValueB[i])
      {
          case SUMMON_TYPE_GUARDIAN:
          case SUMMON_TYPE_POSESSED:

this code bellow is too huge to put it into [/code][/code] because the page dont allow it, so i copy the code here, just put it AT THE END OF SPELLEFFECTS.CPP

Code
void Spell::EffectSpecialSummon( uint32 spell_id, uint32 i, Unit* m_caster )
{
SpellEntry const *summon_spell = sSpellStore.LookupEntry(spell_id);
if(!summon_spell)
return;
uint32 summon_entry = summon_spell->EffectMiscValue[i];
sLog.outError(" creature ID %d in spell : %d", summon_entry, spell_id);
if(!summon_entry)
{
summon_entry = 7560;
sLog.outError("missing summoned creature ID in spell : %d", spell_id);
}

uint32 level = m_caster->getLevel();
int32 duration = GetSpellDuration(summon_spell);
// select center of summon position
float center_x = m_caster->GetPositionX();
float center_y = m_caster->GetPositionY();
float center_z = m_caster->GetPositionZ();
float px;
float py;
float pz;

float radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(summo n_spell->EffectRadiusIndex[i]));
if( radius = 0)//damn blizzard, sometimes is radius set in other effect
for(uint8 j = 0; j < 3; j++)
{
radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(summo n_spell->EffectRadiusIndex[j]));
if(radius > 0) break;
}
m_caster->GetRandomPoint(center_x,center_y,center_z,radius, px,py,pz);
switch (spell_id)
{
case 49028://rune weapon, stats like the caster
{
Pet* spawnCreature = new Pet(GUARDIAN_PET);//set as guardian

Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();
if(!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, summon_entry, pet_number))
{
sLog.outError("no such creature entry %u in database, you should add it",summon_entry);
summon_entry = 7560;
if(!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, summon_entry, pet_number))
return;//this should never happen
}
spawnCreature->Relocate(px,py,pz,m_caster->GetOrientation());
if(duration > 0)
spawnCreature->SetDuration(duration);
spawnCreature->SetUInt64Value(UNIT_FIELD_SUMMONEDBY,m_caster->GetGUID());
spawnCreature->setPowerType(POWER_MANA);
spawnCreature->SetMaxPower(POWER_MANA,28 + 10 * level);
spawnCreature->SetPower( POWER_MANA,28 + 10 * level);
spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS , 0);
spawnCreature->SetLevel(level);
spawnCreature->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,m_caste r->getFaction());
spawnCreature->SetUInt32Value(UNIT_FIELD_FLAGS,0);
spawnCreature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP,0) ;
spawnCreature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE,0);
spawnCreature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP,1000) ;
spawnCreature->SetUInt64Value(UNIT_FIELD_CREATEDBY, m_caster->GetGUID());
spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
spawnCreature->SetArmor(m_caster->GetArmor() );
spawnCreature->SetMaxHealth( m_caster->GetMaxHealth() );
spawnCreature->SetHealth( m_caster->GetMaxHealth() );
spawnCreature->SetAttackTime(BASE_ATTACK, m_caster->GetAttackTime(BASE_ATTACK));
spawnCreature->SetBaseWeaponDamage(BASE_ATTACK ,MAXDAMAGE, float(m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)));
spawnCreature->SetBaseWeaponDamage(BASE_ATTACK ,MINDAMAGE, float(m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE)));
spawnCreature->SetFloatValue(UNIT_FIELD_MAXDAMAGE, float(m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)));
spawnCreature->SetFloatValue(UNIT_FIELD_MINDAMAGE, float(m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE)));
spawnCreature->AIM_Initialize();//use AI (guardian AI)
map->Add((Creature*)spawnCreature);
return;
}
case 51533://Feral Spirit (shaman talent)
{
//THIS IS TOTALY WRONG! this should BE PETS,
//but mangos dont suport having 2 pets active
//simultaneosly, so for now set as guardians
Pet* spawnCreature = new Pet(GUARDIAN_PET);//set as guardian

Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();
if(!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, summon_entry, pet_number))
{
sLog.outError("no such creature entry %u in database, you should add it",summon_entry);
summon_entry = 7560;
if(!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, summon_entry, pet_number))
return;//this should never happen
}
spawnCreature->Relocate(px,py,pz,m_caster->GetOrientation());
if(duration > 0)
spawnCreature->SetDuration(duration);
spawnCreature->SetUInt64Value(UNIT_FIELD_SUMMONEDBY,m_caster->GetGUID());
spawnCreature->setPowerType(POWER_MANA);
spawnCreature->SetMaxPower(POWER_MANA,28 + 10 * level);
spawnCreature->SetPower( POWER_MANA,28 + 10 * level);
spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS , 0);
spawnCreature->SetLevel(level);
spawnCreature->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,m_caste r->getFaction());
spawnCreature->SetUInt32Value(UNIT_FIELD_FLAGS,0);
spawnCreature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP,0) ;
spawnCreature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE,0);
spawnCreature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP,1000) ;
spawnCreature->SetUInt64Value(UNIT_FIELD_CREATEDBY, m_caster->GetGUID());
spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
spawnCreature->SetArmor(level * 95) ;//TODO : find correct value
spawnCreature->SetMaxHealth( level * 95 );//TODO : find correct value
spawnCreature->SetHealth( level * 95 );//TODO : find correct value
spawnCreature->SetAttackTime(BASE_ATTACK, 2000); //TODO : find correct value
spawnCreature->SetBaseWeaponDamage(BASE_ATTACK ,MAXDAMAGE, float(level * 1.5));
spawnCreature->SetBaseWeaponDamage(BASE_ATTACK ,MINDAMAGE, float(level * 1.4));
spawnCreature->SetFloatValue(UNIT_FIELD_MAXDAMAGE, float(level * 1.5));
spawnCreature->SetFloatValue(UNIT_FIELD_MINDAMAGE, float(level * 1.4));
spawnCreature->AIM_Initialize();//use AI (guardian AI)
map->Add((Creature*)spawnCreature);
return;
}
case 49206://Summon Gargoyle
{
Pet* spawnCreature = new Pet(GUARDIAN_PET);//set as guardian

Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();
if(!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, summon_entry, pet_number))
{
sLog.outError("no such creature entry %u in database, you should add it",summon_entry);
summon_entry = 7560;
if(!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, summon_entry, pet_number))
return;//this should never happen
}
spawnCreature->Relocate(px,py,pz,m_caster->GetOrientation());
if(duration > 0)
spawnCreature->SetDuration(duration);
spawnCreature->SetUInt64Value(UNIT_FIELD_SUMMONEDBY,m_caster->GetGUID());
spawnCreature->setPowerType(POWER_MANA);
spawnCreature->SetMaxPower(POWER_MANA,28 + 10 * level);
spawnCreature->SetPower( POWER_MANA,28 + 10 * level);
spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS , 0);
spawnCreature->SetLevel(level);
spawnCreature->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,m_caste r->getFaction());
spawnCreature->SetUInt32Value(UNIT_FIELD_FLAGS,0);
spawnCreature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP,0) ;
spawnCreature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE,0);
spawnCreature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP,1000) ;
spawnCreature->SetUInt64Value(UNIT_FIELD_CREATEDBY, m_caster->GetGUID());
spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
spawnCreature->SetArmor(level * 110) ;//TODO : find correct value
spawnCreature->SetMaxHealth( level * 110 );//TODO : find correct value
spawnCreature->SetHealth( level * 110 );//TODO : find correct value
spawnCreature->SetAttackTime(BASE_ATTACK, 2000); //TODO : find correct value
spawnCreature->SetBaseWeaponDamage(BASE_ATTACK ,MAXDAMAGE, float(level * 3));
spawnCreature->SetBaseWeaponDamage(BASE_ATTACK ,MINDAMAGE, float(level * 2));
spawnCreature->SetFloatValue(UNIT_FIELD_MAXDAMAGE, float(level * 3));
spawnCreature->SetFloatValue(UNIT_FIELD_MINDAMAGE, float(level * 2));
spawnCreature->AIM_Initialize();//use AI (guardian AI)
map->Add((Creature*)spawnCreature);
return;
}
case 52150://Raise Dead
{
Pet* spawnCreature = new Pet(GUARDIAN_PET);//set as guardian

Map *map = m_caster->GetMap();
uint32 pet_number = objmgr.GeneratePetNumber();
if(!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, summon_entry, pet_number))
{
sLog.outError("no such creature entry %u in database, you should add it",summon_entry);
summon_entry = 7560;
if(!spawnCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_PET), map, summon_entry, pet_number))
return;//this should never happen
}
spawnCreature->Relocate(m_caster->GetPositionX(),m_caster->GetPositionY(),m_caster->GetPositionZ(),m_caster->GetOrientation());
if(duration > 0)
spawnCreature->SetDuration(duration);
spawnCreature->SetUInt64Value(UNIT_FIELD_SUMMONEDBY,m_caster->GetGUID());
spawnCreature->setPowerType(POWER_MANA);
spawnCreature->SetMaxPower(POWER_MANA,28 + 10 * level);
spawnCreature->SetPower( POWER_MANA,28 + 10 * level);
spawnCreature->SetUInt32Value(UNIT_NPC_FLAGS , 0);
spawnCreature->SetLevel(level);
spawnCreature->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,m_caste r->getFaction());
spawnCreature->SetUInt32Value(UNIT_FIELD_FLAGS,0);
spawnCreature->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
spawnCreature->SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP,0) ;
spawnCreature->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE,0);
spawnCreature->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP,1000) ;
spawnCreature->SetUInt64Value(UNIT_FIELD_CREATEDBY, m_caster->GetGUID());
spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id);
spawnCreature->SetArmor(level * 110);//TODO : find correct value
spawnCreature->SetMaxHealth( level * 110 );//TODO : find correct value
spawnCreature->SetHealth( level * 110 );//TODO : find correct value
spawnCreature->SetAttackTime(BASE_ATTACK, 2000); //TODO : find correct value
spawnCreature->SetBaseWeaponDamage(BASE_ATTACK ,MAXDAMAGE, float(level * 2.5));
spawnCreature->SetBaseWeaponDamage(BASE_ATTACK ,MINDAMAGE, float(level * 2));
spawnCreature->SetFloatValue(UNIT_FIELD_MAXDAMAGE, float(level * 2.5));
spawnCreature->SetFloatValue(UNIT_FIELD_MINDAMAGE, float(level * 2));
spawnCreature->AIM_Initialize();//use AI (guardian AI)
map->Add((Creature*)spawnCreature);
return;
}
case 51052: //anti-magic zone
{
TempSummonType summonType = TEMPSUMMON_TIMED_DESPAWN;
Creature* spawnCreature = m_caster->SummonCreature(summon_entry,px,py,pz,m_caster->GetOrientation(), summonType, duration);
if (spawnCreature)
{
spawnCreature->SetUInt64Value(UNIT_FIELD_SUMMONEDBY,m_caster->GetGUID());
spawnCreature->setPowerType(POWER_RUNIC_POWER);
spawnCreature->SetMaxPower(POWER_RUNIC_POWER, 100 );
spawnCreature->SetPower(POWER_RUNIC_POWER, 100 );
spawnCreature->SetMaxHealth( 10000 );
spawnCreature->SetHealth( 10000 );
spawnCreature->SetLevel(level);
spawnCreature->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, m_caster->getFaction());
spawnCreature->SetUInt64Value(UNIT_FIELD_CREATEDBY, m_caster->GetGUID());
spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell->Id);
spawnCreature->SetArmor(1);
spawnCreature->SetAttackTime(BASE_ATTACK, 2000);
//spawnCreature->SetVisibility(VISIBILITY_OFF);//not working?
//spawnCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);//not working?
//spawnCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);//not working?
spawnCreature->AIM_Initialize();//use AI (guardian AI)
spawnCreature->CastSpell(((Unit*)spawnCreature),50461, 0, 0, 0, 0);
return;
}
else
{
sLog.outError("missing summoned creature ID in DATABASE : %d, you should add it (for now used temporary spawn)", summon_entry);
summon_entry = 7560;
Creature* spawnCreature2 = m_caster->SummonCreature(summon_entry,px,py,pz,m_caster->GetOrientation(),summonType,duration);
spawnCreature2->SetUInt64Value(UNIT_FIELD_SUMMONEDBY,m_caster->GetGUID());
spawnCreature2->setPowerType(POWER_RUNIC_POWER);
spawnCreature2->SetMaxPower(POWER_RUNIC_POWER, 100 );
spawnCreature2->SetPower(POWER_RUNIC_POWER, 100 );
spawnCreature2->SetMaxHealth( 10000 );
spawnCreature2->SetHealth( 10000 );
spawnCreature2->SetLevel(level);
spawnCreature2->SetFloatValue(OBJECT_FIELD_SCALE_X, float(3));
//the scale of creature increases the scale of spell <img src="http://s8.ucoz.net/sm/1/biggrin.gif" border="0" align="absmiddle" alt="biggrin">
spawnCreature2->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, m_caster->getFaction());
spawnCreature2->SetUInt64Value(UNIT_FIELD_CREATEDBY, m_caster->GetGUID());
spawnCreature2->SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell->Id);
spawnCreature2->SetArmor(1);
spawnCreature2->SetAttackTime(BASE_ATTACK, 2000);
//spawnCreature2->SetVisibility(VISIBILITY_OFF);//not working?
//spawnCreature2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);//not working?
//spawnCreature2->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);//not working?
spawnCreature2->AIM_Initialize();//use AI (guardian AI)
spawnCreature2->CastSpell(((Unit*)spawnCreature2),50461, 0, 0, 0, 0);//TODO : find correct spell id
return;
}

}
default: return;
}
}

ушел навсегда.
Сообщение # 2 отредактировано Recon - Среда, 07.07.2010, 20:00
ph3n
Developer
Данная тема была перемещена из раздела Патчи в ядро MaNGOS.
Причина перемещения: устарело

Переместил: ph3n.
Сообщение # 3 написано 14.10.2012 в 13:32
  • Страница 1 из 1
  • 1
Поиск: