/*
* DAWN OF LIGHT - The first free open source DAoC server emulator
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DOL.Database;
using DOL.GS.PacketHandler;
using DOL.GS.Spells;
namespace DOL.GS.Items
{
public class GameMythirian : GameInventoryItem
{
public const ushort m_equipEffect = 8008;
private GameMythirian() { }
public GameMythirian(ItemTemplate template)
: base(template)
{
}
public GameMythirian(ItemUnique template)
: base(template)
{
}
public GameMythirian(InventoryItem item)
: base(item)
{
}
public override void Delve(List<string> delve, GamePlayer player)
{
base.Delve(delve, player);
}
public override bool CanEquip(GamePlayer player)
{
if (player.ChampionLevel >= LevelRequirement)
return base.CanEquip(player);
return false;
}
public override void OnEquipped(GamePlayer player)
{
base.OnEquipped(player);
IsTradable = false;
foreach (GamePlayer vPlayer in player.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
vPlayer.Out.SendSpellEffectAnimation(player, player, m_equipEffect, 0, false, 1);
}
}
}
}
from what i remember, the cap cap bonus increased the stat aswell as the cap of the stat. so on live +7 strength cap cap, would effectively give u 7 str and increase the cap, so its a double stat.Need to find a way to do the mythirian bonuses as well..
I think only the stat cap ones overcap the overcap so you can have 108/108 dex with a +7 dex cap mythirian I think.
/*
* DAWN OF LIGHT - The first free open source DAoC server emulator
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DOL.Database;
using DOL.GS.PacketHandler;
using DOL.GS.Spells;
namespace DOL.GS.Items
{
public class GameBindOnEquipItem : GameInventoryItem
{
private GameBindOnEquipItem() { }
public GameBindOnEquipItem(ItemTemplate template)
: base(template)
{
}
public GameBindOnEquipItem(ItemUnique template)
: base(template)
{
}
public GameBindOnEquipItem(InventoryItem item)
: base(item)
{
}
public override void Delve(List<string> delve, GamePlayer player)
{
base.Delve(delve, player);
}
public override void OnEquipped(GamePlayer player)
{
base.OnEquipped(player);
IsTradable = false;
}
}
}
/*
* DAWN OF LIGHT - The first free open source DAoC server emulator
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DOL.Database;
using DOL.GS.PacketHandler;
using DOL.GS.Spells;
namespace DOL.GS.Items
{
public class GameMythirian : GameBindOnEquipItem
{
public const ushort m_equipEffect = 8008;
public GameMythirian(ItemTemplate template)
: base(template)
{
}
public GameMythirian(ItemUnique template)
: base(template)
{
}
public GameMythirian(InventoryItem item)
: base(item)
{
}
public override void Delve(List<string> delve, GamePlayer player)
{
//add the delve info.
delve.Add("-Requires: Champion Level " + LevelRequirement);
delve.Add(" ");
base.Delve(delve, player);
}
public override bool CanEquip(GamePlayer player)
{
if (player.ChampionLevel >= LevelRequirement)
return true;
return false;
}
public override void OnEquipped(GamePlayer player)
{
base.OnEquipped(player);
//we don't show a visible effect if the item is already bound.
if (!IsTradable)
return;
foreach (GamePlayer vPlayer in player.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
vPlayer.Out.SendSpellEffectAnimation(player, player, m_equipEffect, 0, false, 1);
}
}
}
}
/*
* DAWN OF LIGHT - The first free open source DAoC server emulator
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
using System;
using DOL.Database.Attributes;
namespace DOL.Database
{
/// <summary>
/// Items bound to a character
/// </summary>
[DataTable(TableName = "CharacterXBoundItem")]
public class CharacterXBoundItem : DataObject
{
private int m_id;
private string m_characterID;
private string m_inventoryID
public CharacterXBoundItem()
{
}
/// <summary>
/// Create a new entry
/// </summary>
/// <param name="characterID"></param>
/// <param name="inventoryIDID"></param>
public CharacterXBoundItem(string characterID, string inventoryID)
{
m_characterID = characterID;
m_inventoryID = inventoryID;
}
[PrimaryKey(AutoIncrement=true)]
public int ID
{
get { return m_id; }
set { m_id = value; }
}
/// <summary>
/// DOLCharacters_ID of this player
/// </summary>
[DataElement(Varchar = 100, AllowDbNull = false, IndexColumns = "InventoryID")]
public string Character_ID
{
get { return m_characterID; }
set { m_characterID = value; Dirty = true; }
}
/// <summary>
/// Inventory_ID of the item
/// </summary>
[DataElement(Varchar = 200, AllowDbNull = false")]
public string Inventory_ID
{
get { return m_inventoryID; }
set { m_inventoryID = value; Dirty = true; }
}
}
}
Thought I should point out that the effect will never actually be sent because you're calling the base's onequipped first which sets IsTradeable to false, and then returning if it is immediately after that.wow.. ok so i made a base class for BindOnEquip items, and a class derived from it, GameMythirian.. well.. when i try to equip the item if it doesnt meet requirements (CL Level high enough), the server immediately crashes, sending a stack overflow exception. not sure why this would happen.
Note: the item works flawlessly IF you meet the requirements, so apparently returning false to CanEquip is bad, but not sure what to do about it.
If anyone (@Tola) has any ideas plz let me know
GameBindOnEquipItem:GameMythirian:
- Code: Select all
/*
* DAWN OF LIGHT - The first free open source DAoC server emulator
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DOL.Database;
using DOL.GS.PacketHandler;
using DOL.GS.Spells;
namespace DOL.GS.Items
{
public class GameBindOnEquipItem : GameInventoryItem
{
private GameBindOnEquipItem() { }
public GameBindOnEquipItem(ItemTemplate template)
: base(template)
{
}
public GameBindOnEquipItem(ItemUnique template)
: base(template)
{
}
public GameBindOnEquipItem(InventoryItem item)
: base(item)
{
}
public override void Delve(List<string> delve, GamePlayer player)
{
base.Delve(delve, player);
}
public override void OnEquipped(GamePlayer player)
{
base.OnEquipped(player);
IsTradable = false;
}
}
}
- Code: Select all
/*
* DAWN OF LIGHT - The first free open source DAoC server emulator
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DOL.Database;
using DOL.GS.PacketHandler;
using DOL.GS.Spells;
namespace DOL.GS.Items
{
public class GameMythirian : GameBindOnEquipItem
{
public const ushort m_equipEffect = 8008;
public GameMythirian(ItemTemplate template)
: base(template)
{
}
public GameMythirian(ItemUnique template)
: base(template)
{
}
public GameMythirian(InventoryItem item)
: base(item)
{
}
public override void Delve(List<string> delve, GamePlayer player)
{
//add the delve info.
delve.Add("-Requires: Champion Level " + LevelRequirement);
delve.Add(" ");
base.Delve(delve, player);
}
public override bool CanEquip(GamePlayer player)
{
if (player.ChampionLevel >= LevelRequirement)
return true;
return false;
}
public override void OnEquipped(GamePlayer player)
{
base.OnEquipped(player);
//we don't show a visible effect if the item is already bound.
if (!IsTradable)
return;
foreach (GamePlayer vPlayer in player.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
vPlayer.Out.SendSpellEffectAnimation(player, player, m_equipEffect, 0, false, 1);
}
}
}
}
If you look my friend, it doesn't return base, it simply calls the base functionsThought I should point out that the effect will never actually be sent because you're calling the base's onequipped first which sets IsTradeable to false, and then returning if it is immediately after that.
- Code: Select all
public override void OnEquipped(GamePlayer player)
{
base.OnEquipped(player);
//we don't show a visible effect if the item is already bound.
if (!IsTradable)
return;
foreach (GamePlayer vPlayer in player.GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
vPlayer.Out.SendSpellEffectAnimation(player, player, m_equipEffect, 0, false, 1);
}
}
}
}
Return to “%s” DOL Code Contributions
Users browsing this forum: No registered users and 0 guests