void SpellShell::timeout() { SpellItem* spell; QValueList<SpellItem*>::Iterator it = m_spellList.begin(); while (it != m_spellList.end()) { spell = *it; int d = spell->duration() - pSEQPrefs->getPrefInt("SpellTimer", "SpellList", 6); if (d > -6) { spell->setDuration(d); emit changeSpell(spell); it++; } else { seqInfo("SpellItem '%s' finished.", (*it)->spellName().latin1()); if (m_lastPlayerSpell == spell) m_lastPlayerSpell = 0; emit delSpell(spell); it = m_spellList.remove(it); delete spell; } } if (m_spellList.count() == 0) m_timer->stop(); }
void SpellShell::killSpawn(const Item* deceased) { uint16_t id = deceased->id(); SpellItem* spell; if (m_lastPlayerSpell && (m_lastPlayerSpell->targetId() == id)) m_lastPlayerSpell = 0; QValueList<SpellItem*>::Iterator it = m_spellList.begin(); while(it != m_spellList.end()) { spell = *it; if (spell->targetId() == id) { it = m_spellList.remove(it); emit delSpell(spell); delete spell; } else ++it; } if (m_spellList.count() == 0) m_timer->stop(); }
void SpellShell::DeleteSpell(SpellItem *item) { if (item) { m_spellList.remove(item); if (m_spellList.count() == 0) m_timer->stop(); emit delSpell(item); delete item; } }
void SpellShell::deleteSpell(SpellItem *item) { if (item) { if (m_lastPlayerSpell == item) m_lastPlayerSpell = 0; m_spellList.remove(item); if (m_spellList.count() == 0) m_timer->stop(); emit delSpell(item); delete item; } }
void SpellShell::killSpawn(const Item* deceased) { uint16_t id = deceased->id(); if (id == m_player->id()) { // We're dead. No more buffs for us. clear(); } else { SpellItem* spell; if (m_lastPlayerSpell && (m_lastPlayerSpell->targetId() == id)) { m_lastPlayerSpell = 0; } QValueList<SpellItem*>::Iterator it = m_spellList.begin(); while(it != m_spellList.end()) { spell = *it; if (spell->targetId() == id) { it = m_spellList.remove(it); emit delSpell(spell); delete spell; } else { ++it; } } if (m_spellList.count() == 0) { m_timer->stop(); } } }