bool MasterDemonologist5(uint8_t /*effectIndex*/, Spell* s) { Player* p_caster = s->p_caster; Unit* unitTarget = s->GetUnitTarget(); if (!p_caster || !unitTarget) return false; //can't imagine how this talent got to anybody else then a player casting on pet uint32 casted_spell_id = 0; uint32 inc_resist_by_level = 0; uint32 inc_resist_by_level_spell = 0; if (unitTarget->getEntry() == 416) //in case it is imp casted_spell_id = 23829; else if (unitTarget->getEntry() == 1860) //VoidWalker casted_spell_id = 23844; else if (unitTarget->getEntry() == 1863) //Succubus casted_spell_id = 23836; else if (unitTarget->getEntry() == 417) //Felhunter { casted_spell_id = 0; inc_resist_by_level_spell = 23840; inc_resist_by_level = 100; } else if (unitTarget->getEntry() == 17252) //Felguard { casted_spell_id = 35706; inc_resist_by_level_spell = 23840; inc_resist_by_level = 50; } if (casted_spell_id) { //for self Spell* sp = sSpellMgr.newSpell(p_caster, sSpellMgr.getSpellInfo(casted_spell_id), true, nullptr); SpellCastTargets tgt(p_caster->getGuid()); sp->prepare(&tgt); //for pet sp = sSpellMgr.newSpell(unitTarget, sSpellMgr.getSpellInfo(casted_spell_id), true, nullptr); SpellCastTargets tgt1(unitTarget->getGuid()); sp->prepare(&tgt1); } if (inc_resist_by_level_spell) { //for self Spell* sp = sSpellMgr.newSpell(p_caster, sSpellMgr.getSpellInfo(inc_resist_by_level_spell), true, nullptr); SpellCastTargets tgt(p_caster->getGuid()); sp->prepare(&tgt); //for pet sp = sSpellMgr.newSpell(unitTarget, sSpellMgr.getSpellInfo(inc_resist_by_level_spell), true, nullptr); SpellCastTargets tgt1(unitTarget->getGuid()); sp->prepare(&tgt1); } return true; }
bool MasterDemonologist4(uint32 i, Spell* s) { Player* p_caster = s->p_caster; Unit* unitTarget = s->GetUnitTarget(); if(!p_caster || !unitTarget) return false; //can't imagine how this talent got to anybody else then a player casting on pet uint32 casted_spell_id = 0 ; uint32 inc_resist_by_level = 0 ; uint32 inc_resist_by_level_spell = 0 ; if(unitTarget->GetEntry() == 416) //in case it is imp casted_spell_id = 23828 ; else if(unitTarget->GetEntry() == 1860) //VoidWalker casted_spell_id = 23843 ; else if(unitTarget->GetEntry() == 1863) //Succubus casted_spell_id = 23835 ; else if(unitTarget->GetEntry() == 417) //Felhunter { casted_spell_id = 0 ; inc_resist_by_level_spell = 23839 ; inc_resist_by_level = 80 ; } else if(unitTarget->GetEntry() == 17252) //Felguard { casted_spell_id = 35705 ; inc_resist_by_level_spell = 23839 ; inc_resist_by_level = 40 ; } if(casted_spell_id) { //for self Spell* sp = sSpellFactoryMgr.NewSpell(p_caster, dbcSpell.LookupEntry(casted_spell_id), true, NULL); SpellCastTargets tgt(p_caster->GetGUID()); sp->prepare(&tgt); //for pet sp = sSpellFactoryMgr.NewSpell(unitTarget, dbcSpell.LookupEntry(casted_spell_id), true, NULL); SpellCastTargets tgt1(unitTarget->GetGUID()); sp->prepare(&tgt1); } if(inc_resist_by_level_spell) { //for self Spell* sp = sSpellFactoryMgr.NewSpell(p_caster, dbcSpell.LookupEntry(inc_resist_by_level_spell), true, NULL); SpellCastTargets tgt(p_caster->GetGUID()); sp->prepare(&tgt); //for pet sp = sSpellFactoryMgr.NewSpell(unitTarget, dbcSpell.LookupEntry(inc_resist_by_level_spell), true, NULL); SpellCastTargets tgt1(unitTarget->GetGUID()); sp->prepare(&tgt1); } return true; }
/** * Get list of runs associated with production * * @param url The production URL * @param mc True of MC * @param minSize Least size of runs to use * * @return true on success */ Bool_t GetRuns(const TString& url, Bool_t mc, ULong_t minSize) { TString index("job"); if (!Download(Form("%s%s", (mc ? "" : "raw/"), url.Data()), index)) return false; std::ifstream in(index.Data()); TString tgt1(mc ? "window.open" : "runDetails"); TString line = ""; do { line.ReadLine(in); if (!line.Contains(tgt1)) continue; Int_t first = -1; Int_t last = -1; if (!mc) { first = line.Index(tgt1); last = line.Index(")", first+tgt1.Length()+1); } else { Int_t tmp = line.Index(">"); first = line.Index(">", tmp+1); last = line.Index("<", first); } if (first == kNPOS || last == kNPOS) { Error("GetDir", "Failed to get directory from %s", line.Data()); return false; } first += (mc ? 1 : tgt1.Length()+1); last -= first; TString srun = line(first, last); ULong_t runNo = srun.Atoll(); if (fDebug) Info("", "Got run %lu (%s)", runNo, srun.Data()); if (!GetSize(in, runNo, mc, minSize)) continue; if (!GetDir(in, runNo, mc)) continue; if (!fRuns.IsNull()) fRuns.Append(","); fRuns.Append(Form("%lu", runNo)); } while (!in.eof()); in.close(); if (fRuns.IsNull()) return false; return true; }