mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-22 05:32:26 +00:00
Merge pull request #287 from KayenEQ/Development
Implemented support for using target rings from item clicks
This commit is contained in:
commit
39cab761eb
@ -1,7 +1,10 @@
|
|||||||
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
EQEMu Changelog (Started on Sept 24, 2003 15:50)
|
||||||
-------------------------------------------------------
|
-------------------------------------------------------
|
||||||
|
|
||||||
== 11/09/2014 ==
|
== 11/09/2014 ==
|
||||||
Kayen: Implemented support for spell target type (45) 'Target Rings' on Underfoot (does work earlier expansions). Thanks to Lecht for figuring out the op_code side.
|
Kayen: Implemented support for spell target type (45) 'Target Rings' on Underfoot (does work earlier expansions)
|
||||||
|
Thanks to Lecht for figuring out the op_code side.
|
||||||
|
Implement new Live-like faction adjustment message using rule Client:UseLiveFactionMessage.
|
||||||
JJ: Implement new Live-like faction adjustment message using rule Client:UseLiveFactionMessage.
|
JJ: Implement new Live-like faction adjustment message using rule Client:UseLiveFactionMessage.
|
||||||
Optional SQL: utils/sql/git/optional/2014_11_09_LiveFactionMessages.sql
|
Optional SQL: utils/sql/git/optional/2014_11_09_LiveFactionMessages.sql
|
||||||
|
|
||||||
|
|||||||
@ -478,11 +478,11 @@ struct CastSpell_Struct
|
|||||||
uint32 spell_id;
|
uint32 spell_id;
|
||||||
uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast
|
uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast
|
||||||
uint32 target_id;
|
uint32 target_id;
|
||||||
uint32 cs_unknown1;
|
uint32 cs_unknown1;
|
||||||
uint32 cs_unknown2;
|
uint32 cs_unknown2;
|
||||||
float y_pos;
|
float y_pos;
|
||||||
float x_pos;
|
float x_pos;
|
||||||
float z_pos;
|
float z_pos;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SpellEffect_Struct
|
struct SpellEffect_Struct
|
||||||
|
|||||||
@ -519,11 +519,11 @@ struct CastSpell_Struct
|
|||||||
uint32 spell_id;
|
uint32 spell_id;
|
||||||
uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast
|
uint32 inventoryslot; // slot for clicky item, 0xFFFF = normal cast
|
||||||
uint32 target_id;
|
uint32 target_id;
|
||||||
uint32 cs_unknown1;
|
uint32 cs_unknown1;
|
||||||
uint32 cs_unknown2;
|
uint32 cs_unknown2;
|
||||||
float y_pos;
|
float y_pos;
|
||||||
float x_pos;
|
float x_pos;
|
||||||
float z_pos;
|
float z_pos;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -4004,6 +4004,10 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
CastSpell_Struct* castspell = (CastSpell_Struct*)app->pBuffer;
|
CastSpell_Struct* castspell = (CastSpell_Struct*)app->pBuffer;
|
||||||
|
|
||||||
|
targetring_x = castspell->x_pos;
|
||||||
|
targetring_y = castspell->y_pos;
|
||||||
|
targetring_z = castspell->z_pos;
|
||||||
|
|
||||||
#ifdef _EQDEBUG
|
#ifdef _EQDEBUG
|
||||||
LogFile->write(EQEMuLog::Debug, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]);
|
LogFile->write(EQEMuLog::Debug, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]);
|
||||||
LogFile->write(EQEMuLog::Debug, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]);
|
LogFile->write(EQEMuLog::Debug, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]);
|
||||||
@ -4041,7 +4045,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
|
|||||||
CastSpell(spell_to_cast, castspell->target_id, castspell->slot);
|
CastSpell(spell_to_cast, castspell->target_id, castspell->slot);
|
||||||
}
|
}
|
||||||
/* Spell Slot or Potion Belt Slot */
|
/* Spell Slot or Potion Belt Slot */
|
||||||
else if ((castspell->slot == USE_ITEM_SPELL_SLOT) || (castspell->slot == POTION_BELT_SPELL_SLOT)) // ITEM or POTION cast
|
else if ((castspell->slot == USE_ITEM_SPELL_SLOT) || (castspell->slot == POTION_BELT_SPELL_SLOT)|| (castspell->slot == TARGET_RING_SPELL_SLOT)) // ITEM or POTION cast
|
||||||
{
|
{
|
||||||
//discipline, using the item spell slot
|
//discipline, using the item spell slot
|
||||||
if (castspell->inventoryslot == INVALID_INDEX) {
|
if (castspell->inventoryslot == INVALID_INDEX) {
|
||||||
@ -4051,7 +4055,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (m_inv.SupportsClickCasting(castspell->inventoryslot) || (castspell->slot == POTION_BELT_SPELL_SLOT)) // sanity check
|
else if (m_inv.SupportsClickCasting(castspell->inventoryslot) || (castspell->slot == POTION_BELT_SPELL_SLOT) || (castspell->slot == TARGET_RING_SPELL_SLOT)) // sanity check
|
||||||
{
|
{
|
||||||
// packet field types will be reviewed as packet transistions occur -U
|
// packet field types will be reviewed as packet transistions occur -U
|
||||||
const ItemInst* inst = m_inv[castspell->inventoryslot]; //slot values are int16, need to check packet on this field
|
const ItemInst* inst = m_inv[castspell->inventoryslot]; //slot values are int16, need to check packet on this field
|
||||||
@ -8646,6 +8650,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
|
|||||||
IsFeared() ||
|
IsFeared() ||
|
||||||
IsMezzed() ||
|
IsMezzed() ||
|
||||||
DivineAura() ||
|
DivineAura() ||
|
||||||
|
(spells[spell_id].targettype == ST_Ring) ||
|
||||||
(IsSilenced() && !IsDiscipline(spell_id)) ||
|
(IsSilenced() && !IsDiscipline(spell_id)) ||
|
||||||
(IsAmnesiad() && IsDiscipline(spell_id)) ||
|
(IsAmnesiad() && IsDiscipline(spell_id)) ||
|
||||||
(IsDetrimentalSpell(spell_id) && !zone->CanDoCombat())
|
(IsDetrimentalSpell(spell_id) && !zone->CanDoCombat())
|
||||||
|
|||||||
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#define USE_ITEM_SPELL_SLOT 10
|
#define USE_ITEM_SPELL_SLOT 10
|
||||||
#define POTION_BELT_SPELL_SLOT 11
|
#define POTION_BELT_SPELL_SLOT 11
|
||||||
|
#define TARGET_RING_SPELL_SLOT 12
|
||||||
#define DISCIPLINE_SPELL_SLOT 10
|
#define DISCIPLINE_SPELL_SLOT 10
|
||||||
#define ABILITY_SPELL_SLOT 9
|
#define ABILITY_SPELL_SLOT 9
|
||||||
|
|
||||||
|
|||||||
@ -254,7 +254,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot,
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Added to prevent MQ2 exploitation of equipping normally-unequippable/clickable items with effects and clicking them for benefits.
|
//Added to prevent MQ2 exploitation of equipping normally-unequippable/clickable items with effects and clicking them for benefits.
|
||||||
if(item_slot && IsClient() && ((slot == USE_ITEM_SPELL_SLOT) || (slot == POTION_BELT_SPELL_SLOT)))
|
if(item_slot && IsClient() && ((slot == USE_ITEM_SPELL_SLOT) || (slot == POTION_BELT_SPELL_SLOT) || (slot == TARGET_RING_SPELL_SLOT)))
|
||||||
{
|
{
|
||||||
ItemInst *itm = CastToClient()->GetInv().GetItem(item_slot);
|
ItemInst *itm = CastToClient()->GetInv().GetItem(item_slot);
|
||||||
int bitmask = 1;
|
int bitmask = 1;
|
||||||
@ -885,7 +885,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
|
|||||||
{
|
{
|
||||||
bool IsFromItem = false;
|
bool IsFromItem = false;
|
||||||
|
|
||||||
if(IsClient() && slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && spells[spell_id].recast_time > 1000) { // 10 is item
|
if(IsClient() && slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && slot != TARGET_RING_SPELL_SLOT && spells[spell_id].recast_time > 1000) { // 10 is item
|
||||||
if(!CastToClient()->GetPTimers().Expired(&database, pTimerSpellStart + spell_id, false)) {
|
if(!CastToClient()->GetPTimers().Expired(&database, pTimerSpellStart + spell_id, false)) {
|
||||||
//should we issue a message or send them a spell gem packet?
|
//should we issue a message or send them a spell gem packet?
|
||||||
Message_StringID(13, SPELL_RECAST);
|
Message_StringID(13, SPELL_RECAST);
|
||||||
@ -895,7 +895,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsClient() && ((slot == USE_ITEM_SPELL_SLOT) || (slot == POTION_BELT_SPELL_SLOT)))
|
if(IsClient() && ((slot == USE_ITEM_SPELL_SLOT) || (slot == POTION_BELT_SPELL_SLOT) || (slot == TARGET_RING_SPELL_SLOT)))
|
||||||
{
|
{
|
||||||
IsFromItem = true;
|
IsFromItem = true;
|
||||||
ItemInst *itm = CastToClient()->GetInv().GetItem(inventory_slot);
|
ItemInst *itm = CastToClient()->GetInv().GetItem(inventory_slot);
|
||||||
@ -1191,7 +1191,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot,
|
|||||||
|
|
||||||
int16 DeleteChargeFromSlot = -1;
|
int16 DeleteChargeFromSlot = -1;
|
||||||
|
|
||||||
if(IsClient() && ((slot == USE_ITEM_SPELL_SLOT) || (slot == POTION_BELT_SPELL_SLOT))
|
if(IsClient() && ((slot == USE_ITEM_SPELL_SLOT) || (slot == POTION_BELT_SPELL_SLOT) || (slot == TARGET_RING_SPELL_SLOT))
|
||||||
&& inventory_slot != 0xFFFFFFFF) // 10 is an item
|
&& inventory_slot != 0xFFFFFFFF) // 10 is an item
|
||||||
{
|
{
|
||||||
bool fromaug = false;
|
bool fromaug = false;
|
||||||
@ -2194,7 +2194,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16
|
|||||||
|
|
||||||
// if this was a spell slot or an ability use up the mana for it
|
// if this was a spell slot or an ability use up the mana for it
|
||||||
// CastSpell already reduced the cost for it if we're a client with focus
|
// CastSpell already reduced the cost for it if we're a client with focus
|
||||||
if(slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && mana_used > 0)
|
if(slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && slot != TARGET_RING_SPELL_SLOT && mana_used > 0)
|
||||||
{
|
{
|
||||||
mlog(SPELLS__CASTING, "Spell %d: consuming %d mana", spell_id, mana_used);
|
mlog(SPELLS__CASTING, "Spell %d: consuming %d mana", spell_id, mana_used);
|
||||||
if (!DoHPToManaCovert(mana_used))
|
if (!DoHPToManaCovert(mana_used))
|
||||||
@ -2229,7 +2229,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IsClient() && ((slot == USE_ITEM_SPELL_SLOT) || (slot == POTION_BELT_SPELL_SLOT)))
|
if(IsClient() && ((slot == USE_ITEM_SPELL_SLOT) || (slot == POTION_BELT_SPELL_SLOT) || (slot == TARGET_RING_SPELL_SLOT)))
|
||||||
{
|
{
|
||||||
ItemInst *itm = CastToClient()->GetInv().GetItem(inventory_slot);
|
ItemInst *itm = CastToClient()->GetInv().GetItem(inventory_slot);
|
||||||
if(itm && itm->GetItem()->RecastDelay > 0){
|
if(itm && itm->GetItem()->RecastDelay > 0){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user