Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 02-18-2002, 02:11 AM
Kaiyodo
Hill Giant
 
Join Date: Jan 2002
Location: Midlands,UK
Posts: 149
Default Weapon proc spell target

I've written a small bit of code to enable weapon procs to work, however, I can't see a way of working out who the spell should be cast on (always casts on target at the moment). The spell effecttype for 'Avatar' on Primal weapons (which are cast on the player) is the same as 'Anarchy' on the Sceptre of destruction (which should be cast on the target).

Anyone know how to determine who the target should be from the spell/item? I've included to the code I put in, should anyone want it. It goes in right at the bottom of Client::Attack() in attack.cpp.

Code:
// Check for proc on weapon, proc based on DEX (Kaiyodo mod)
if((float)rand()/RAND_MAX < (GetDEX()/1500.0f))		// 255 dex = 0.17 chance of proc.
{
  if(item && other && other->GetHP() > 0)
  {
    if((item->common.spellId < 65535ul) && (item->common.effecttype == 0))
      SpellFinished(item->common.spellId, other->GetID(), 10, 0);
  }
}
K.
Reply With Quote
  #2  
Old 02-18-2002, 02:39 AM
Schmuck
Sarnak
 
Join Date: Jan 2002
Posts: 46
Default

Well, once/if/when someone comes out with a spell editor, you could create a spell that is exactly like Avatar, only it is self-only and see if that works. Have you tried putting Gate as an item effect? Or Minor Shielding?
__________________
If a kid asks where rain comes from, I think a cute thing to tell him is "God is crying." And if he asks why God is crying, another cute thing to tell him is "Probably because of something you did."
Reply With Quote
  #3  
Old 02-18-2002, 03:52 AM
Kaiyodo
Hill Giant
 
Join Date: Jan 2002
Location: Midlands,UK
Posts: 149
Default

The Minor Shielding and Gate spells are flagged as 'Self-only' in the spell data (their spelltype is 'ST_Self'). Spells of this type, as well as any flagged with 'ST_AETarget' or 'ST_AECaster' will work just fine on a proccing weapon. The problems is with spells of type 'ST_Target' that need more information that I actually have, i.e. who to make the target.

I thought for a while that 'beneficial' spells would always proc on the player, while offensive spells proc on the target, but then remembered a few 'cursed' items that can proc offensive spells on the player (like the Cancel Magic proccing sword), so that was a non-starter.

K.
Reply With Quote
  #4  
Old 02-18-2002, 09:15 AM
Schmuck
Sarnak
 
Join Date: Jan 2002
Posts: 46
Default

I know, but if self-only spells proc on yourself, you could make a spell exactly like Avatar, call it something different (or maybe you wouldn't have to, I don't know much about spell identification), but just make it self-only. This would be the "jerry-rigging" temporary fix, but it should work...
__________________
If a kid asks where rain comes from, I think a cute thing to tell him is "God is crying." And if he asks why God is crying, another cute thing to tell him is "Probably because of something you did."
Reply With Quote
  #5  
Old 02-18-2002, 10:26 AM
Kaiyodo
Hill Giant
 
Join Date: Jan 2002
Location: Midlands,UK
Posts: 149
Default

That would certainly work, I've got a temporary bodge in there at the moment that basically goes 'if spell = avatar, target = me'. It's crude, but it lets me have fun with the primal weapons

K.
Reply With Quote
  #6  
Old 02-18-2002, 12:06 PM
Lurker_005
Demi-God
 
Join Date: Jan 2002
Location: Tourist town USA
Posts: 1,671
Default

Is there possibly an overlooked bit of data in the item info that says who the spell proc is on? That would seem to make the most sense. Try comparing items that proc on target with items that proc on wielder....
Reply With Quote
  #7  
Old 02-19-2002, 01:48 AM
Pyrotek
Sarnak
 
Join Date: Jan 2002
Posts: 97
Default

Avatar is the spell that shamans get. Primal Avatar is the proc on the weapon. I haven't looked but i'm betting it's self only.
Reply With Quote
  #8  
Old 02-19-2002, 05:39 AM
Kaiyodo
Hill Giant
 
Join Date: Jan 2002
Location: Midlands,UK
Posts: 149
Default

I'm pretty sure it's a targetable spell, Primal Avatar is a dropped spell in Sleepers I believe, a componentless version of Avatar.

The weapons I've been testing with are from the standard DB in the EQEmu zipfile (Primal velium warsword to be specific) so I'd presume all of the data for the weapon is spot on, i.e. packet sniffed from real EQ. All I do is cast the spell number that the weapon tells me to, I'm sure I'm just missing a bit of secret info stored in the weapon somewhere.

K.
Reply With Quote
  #9  
Old 02-19-2002, 06:58 AM
Pyrotek
Sarnak
 
Join Date: Jan 2002
Posts: 97
Default

Well, was a shot. I'll take a look deeper when i'm at home and have some time.
Reply With Quote
  #10  
Old 02-19-2002, 08:55 AM
Yodason
Hill Giant
 
Join Date: Jan 2002
Posts: 205
Default

theres a primal avatar for shamans it doesnt take regent.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 04:38 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3