- Code: Select all
public static int GetEffectSlot(string spellName)
{
switch(spellName)
{
case "Chamber of Minor Fate":
return 1;
case "Chamber of Restraint":
return 2;
case "Chamber of Destruction":
return 3;
case "Chamber of Fate":
return 4;
case "Chamber of Greater Fate":
return 5;
}
return 0;
}
Handled in GamePlayer -> CastSpell
- Code: Select all
((ChamberSpellHandler)spellhandler).EffectSlot = ChamberSpellHandler.GetEffectSlot(spellhandler.Spell.Name));
New Possible Method considering you get 6chambers total but only possible 5 to have up with split/tri spec....
- Code: Select all
private int chamberCheck = 0;
public override void FinishSpellCast(GameLiving target)
{
m_caster.Mana -= PowerCost(target);
// endurance
m_caster.Endurance -= 5;
// messages
GamePlayer caster = (GamePlayer)m_caster;
if (Spell.InstrumentRequirement == 0)
{
if(SecondarySpell == null && PrimarySpell == null)
{
MessageToCaster("No spells were loaded into " + m_spell.Name + ".", eChatType.CT_Spell);
}
else
{
switch (chamberCheck)
{
case 0:
chamberCheck++;
this.EffectSlot = 1;
return;
case 1:
chamberCheck++;
this.EffectSlot = 2;
return;
case 2:
chamberCheck++;
this.EffectSlot = 3;
return;
case 3:
chamberCheck++;
this.EffectSlot = 4;
return;
case 4:
chamberCheck++;
this.EffectSlot = 5;
return;
}
MessageToCaster("Your " + m_spell.Name + " is ready for use.", eChatType.CT_Spell);
//StartSpell(target); // and action
GameSpellEffect neweffect = CreateSpellEffect(target, 1);
neweffect.Start(m_caster);
SendEffectAnimation(m_caster, 0, false, 1);
((GamePlayer)m_caster).Out.SendWarlockChamberEffect((GamePlayer)m_caster);
}
foreach (GamePlayer player in m_caster.GetPlayersInRadius(WorldMgr.INFO_DISTANCE))
{
if (player != m_caster)
player.Out.SendMessage(m_caster.GetName(0, true) + " casts a spell!", eChatType.CT_Spell, eChatLoc.CL_SystemWindow);
}
}
//the quick cast is unallowed whenever you miss the spell
//set the time when casting to can not quickcast during a minimum time
if (m_caster is GamePlayer)
{
QuickCastEffect quickcast = (QuickCastEffect) m_caster.EffectList.GetOfType(typeof (QuickCastEffect));
if (quickcast != null && Spell.CastTime > 0)
{
((GamePlayer) m_caster).TempProperties.setProperty(GamePlayer.QUICK_CAST_CHANGE_TICK, m_caster.CurrentRegion.Time);
((GamePlayer) m_caster).DisableSkill(SkillBase.GetAbility(Abilities.Quickcast), QuickCastAbilityHandler.DISABLE_DURATION);
quickcast.Cancel(false);
}
}
}
public override int OnEffectExpires(GameSpellEffect effect, bool noMessages)
{
chamberCheck--;
((GamePlayer)m_caster).Out.SendWarlockChamberEffect((GamePlayer)effect.Owner);
return base.OnEffectExpires (effect, noMessages);
}