[src] Magic Weapons

Codes already submitted by people of the forums.
Dax
<3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

I made this code for HBSecret but they've had it for a while now so I guess others should be allowed to play with magical weapons too.

Note no extra damage is added as a result of these effects. If you want extra damage code your own in iCalculateAttackEffect or wait for some other poor prick to do it for you (you people seem to be good at that)

Example used in this code

Code: Select all

Item = 293 Striker 1 9 1 2 7 0 2 8 0 800 2 1 7 250 2800 8 6 0 0 -3 2 8 1 0
Wep: Striker
Type: 2 hand
ID: 293
Sprite: BroadSword
Magic effects:
Critical: Casts Mass-Magic-Missile Aura on the attacker and shoots Energy-Bolt at the target.
Normal/dash: Shoots Magic-Missile

Game.cpp
Function: iClientMotion_Attack_Handler
Find

Code: Select all

if (sOwner != NULL) {
  if ((wType != 0) && ((dwTime - m_pClientList[iClientH]->m_dwRecentAttackTime) > 100)) { 
  	if ((m_pClientList[iClientH]->m_pIsProcessingAllowed == FALSE) && (m_pClientList[iClientH]->m_bIsInsideWarehouse == FALSE) 
    && (m_pClientList[iClientH]->m_bIsInsideWizardTower == FALSE) && (m_pClientList[iClientH]->m_bIsInsideOwnTown == FALSE)) {
Add this under it

Code: Select all

/***************************************
 ********** Magic Weapons **********
 ***************************************/
	sItemIndex = m_pClientList[iClientH]->m_sItemEquipmentStatus[ DEF_EQUIPPOS_TWOHAND ];
	if (sItemIndex != -1 && m_pClientList[iClientH]->m_pItemList[sItemIndex] != NULL)
	{
  if ((m_pClientList[iClientH]->m_sAppr2 & 0xF000) != 0)
  {
  	if(m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 293) // Striker
  	{
    short sType;

    if(wType >= 20) // (ALT) Critical Attack
    {
    	sType = 84; // Mass-Magic-Missile Aura
    	SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[iClientH]->m_cMapIndex, sX, sY, sX, sY, (sType+100), m_pClientList[iClientH]->m_sType);

    	sType = 10; // Energy-Bolt
    	SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[iClientH]->m_cMapIndex, sX, sY, dX, dY, (sType+100), m_pClientList[iClientH]->m_sType);
    }
    else // Dash/Normal Attack
    {
    	sType = 0; // Magic-Missile
    	SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[iClientH]->m_cMapIndex, sX, sY, dX, dY, (sType+100), m_pClientList[iClientH]->m_sType);
    }
  	}
  }
	}
/***************************************
 ***************************************/
Image
SS shooting MM
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Dax wrote: I made this code for HBSecret but they've had it for a while now so I guess others should be allowed to play with magical weapons too.

Note no extra damage is added as a result of these effects. If you want extra damage code your own in iCalculateAttackEffect or wait for some other poor prick to do it for you (you people seem to be good at that)

Example used in this code
Wep: Striker
Type: 2 hand
ID: 293
Sprite: BroadSword
Magic effects:
Critical: Casts Mass-Magic-Missile Aura on the attacker and shoots Energy-Bolt at the target.
Normal/dash: Shoots Magic-Missile

Client.cpp
Function: iClientMotion_Attack_Handler
Find

Code: Select all

if (sOwner != NULL) {
  if ((wType != 0) && ((dwTime - m_pClientList[iClientH]->m_dwRecentAttackTime) > 100)) { 
  	if ((m_pClientList[iClientH]->m_pIsProcessingAllowed == FALSE) && (m_pClientList[iClientH]->m_bIsInsideWarehouse == FALSE) 
    && (m_pClientList[iClientH]->m_bIsInsideWizardTower == FALSE) && (m_pClientList[iClientH]->m_bIsInsideOwnTown == FALSE)) {
Add this under it

Code: Select all

/***************************************
 ********** Magic Weapons **********
 ***************************************/
	sItemIndex = m_pClientList[iClientH]->m_sItemEquipmentStatus[ DEF_EQUIPPOS_TWOHAND ];
	if (sItemIndex != -1 && m_pClientList[iClientH]->m_pItemList[sItemIndex] != NULL)
	{
  if ((m_pClientList[iClientH]->m_sAppr2 & 0xF000) != 0)
  {
  	if(m_pClientList[iClientH]->m_pItemList[sItemIndex]->m_sIDnum == 293) // Striker
  	{
    short sType;

    if(wType >= 20) // (ALT) Critical Attack
    {
    	sType = 84; // Mass-Magic-Missile Aura
    	SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[iClientH]->m_cMapIndex, sX, sY, sX, sY, (sType+100), m_pClientList[iClientH]->m_sType);

    	sType = 10; // Energy-Bolt
    	SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[iClientH]->m_cMapIndex, sX, sY, dX, dY, (sType+100), m_pClientList[iClientH]->m_sType);
    }
    else // Dash/Normal Attack
    {
    	sType = 0; // Magic-Missile
    	SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[iClientH]->m_cMapIndex, sX, sY, dX, dY, (sType+100), m_pClientList[iClientH]->m_sType);
    }
  	}
  }
	}
/***************************************
 ***************************************/
Image
SS shooting MM
:) Nice code Dax B)

Thanks :)

P.D: Ownage signature.
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
Tafka12
&lt;3 bd long time
Posts: 772
Joined: Wed Dec 28, 2005 6:32 pm

Post by Tafka12 »

Cool code!
<img src='http://www.hot.ee/carvanho/taavi.png' border='0' alt='user posted image' /><br><br><img src='http://www.hot.ee/carvanho/Elvine.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/LieroX.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/Football.png' border='0' alt='user posted image' />
tester
Outpost bitch
Posts: 544
Joined: Wed Jan 07, 2004 8:58 pm

Post by tester »

Is the damage magic stat dependant?
Guess not....


Cheers Tester
I support a woman's right to choose<br><br>- In the Mouth?<br>- In the Ass ?<br>- In the Vagina?<br>- Between the Tits?
€M4NU€L
Outpost bitch
Posts: 517
Joined: Sat Nov 19, 2005 9:07 pm
Location: I watch gay porn
Contact:

Post by €M4NU€L »

Code: Select all

   sType = 10; // Energy-Bolt
    SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[iClientH]->m_cMapIndex, sX, sY, dX, dY, (sType+100), m_pClientList[iClientH]->m_sType);

Code: Select all

sType = 10; // Energy-Bolt
You can change the 10 for other number and it throws other Sprite =) but right now i dont want to post the Numbers =P
<span style='color:blue'>Helbreath Thermal</span> <span style='color:green'>BETA</span> <span style='color:red'>Soon</span>:<br><br>www.youporngay.com<br><br><img src='http://img264.imageshack.us/img264/1041 ... piopk7.jpg' border='0' alt='user posted image' /><br><img src='http://img257.imageshack.us/img257/3762 ... eakxj1.jpg' border='0' alt='user posted image' /><br><img src='http://arthur.crepin.free.fr/images/use ... mpsons.png' border='0' alt='user posted image' /><br><img src='http://img329.imageshack.us/img329/5797/pesgamerrr3.gif' border='0' alt='user posted image' /><br><br><u><b>BLACK GAY LIST:</b></u><br><br><span style='color:red'>€M4NU€L</span>:<br>I look like a girl and he's always complaining someone.
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

€M4NU€L wrote:

Code: Select all

   sType = 10; // Energy-Bolt
    SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[iClientH]->m_cMapIndex, sX, sY, dX, dY, (sType+100), m_pClientList[iClientH]->m_sType);

Code: Select all

sType = 10; // Energy-Bolt
You can change the 10 for other number and it throws other Sprite =) but right now i dont want to post the Numbers =P
Are you sure???????? OMFG!!!! THANKS A LOT I DIDIN'T KNEW THAT PARTTTTTTTTTTT :blink:
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

€M4NU€L wrote:

Code: Select all

   sType = 10; // Energy-Bolt
    SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[iClientH]->m_cMapIndex, sX, sY, dX, dY, (sType+100), m_pClientList[iClientH]->m_sType);

Code: Select all

sType = 10; // Energy-Bolt
You can change the 10 for other number and it throws other Sprite =) but right now i dont want  to post the Numbers =P

Code: Select all

[MAGIC]

//------Num-Name
magic = 0   Magic-Missile
magic = 1   Heal
magic = 2   Create-Food
magic = 10  Energy-Bolt 
magic = 11  Staminar-Drain
magic = 12  Recall 
magic = 13  Defense-Shield
magic = 14  Celebrating-Light
magic = 20  Fire-Ball
magic = 21  Great-Heal
magic = 23  Staminar-Recovery 
magic = 24  Protection-From-Arrow 
magic = 25  Hold-Person
magic = 26  Possession 
magic = 27  Poison 
magic = 28  Great-Staminar-Recov.
magic = 30  Fire-Strike
magic = 31  Summon-Creature
magic = 32  Invisibility
magic = 33  Protection-From-Magic
magic = 34  Detect-Invisibility 
magic = 35  Paralyze 
magic = 36  Cure 
magic = 37  Lightning-Arrow      
magic = 38  Tremor
magic = 40  Fire-Wall
magic = 41  Fire-Field
magic = 42  Confuse-Language
magic = 43  Lightning
magic = 44  Great-Defense-Shield
magic = 45  Chill-Wind
magic = 46  Poison-Cloud 
magic = 47  Triple-Energy-Bolt
magic = 50  Berserk
magic = 51  Lightning-Bolt 
magic = 53  Mass-Poison
magic = 54  Spike-Field
magic = 55  Ice-Storm      
magic = 56  Mass-Lightning-Arrow      
magic = 57  Ice-Strike 
magic = 60  Energy-Strike
magic = 61  Mass-Fire-Strike
magic = 62  Confusion
magic = 63  Mass-Chill-Wind
magic = 64  Earthworm-Strike
magic = 65  Absolute-Magic-Protect. 
magic = 66  Armor-Break
magic = 67  Scan 
magic = 70  Bloody-Shock-Wave 
magic = 71  Mass-Confusion
magic = 72  Mass-Ice-Strike      
magic = 73  Cloud-Kill
magic = 74  Lightning-Strike
magic = 76  Cancellation
magic = 77  Illusion-Movement 
magic = 80  Illusion
magic = 81  Meteor-Strike
magic = 82  Mass-Magic-Missile
magic = 83  Inhibition-Casting 
magic = 90  Mass-Illusion
magic = 91  Blizzard 
magic = 94  Resurrection
magic = 95  Mass-Illusion-Movement
magic = 96  Earth-Shock-Wave
The numbers are the same as their spell IDs + 100. The code already adds +100 to sType when it uses it as the parameter to SendEventToNearClient_TypeB. Just make sType equal to the spell ID of the effect you wish to use.

Example: sType = 91; // Blizzard

Things such as auras must be found by yourself. I used a for loop to test everything from ID 1-203 (I think it was 203 where the effects stop) to view all the possible effects.

Code: Select all

for (int i=0; i <= 203; i++)
{
SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[iClientH]->m_cMapIndex, sX, sY, dX, dY, i, m_pClientList[iClientH]->m_sType);
}
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
€M4NU€L
Outpost bitch
Posts: 517
Joined: Sat Nov 19, 2005 9:07 pm
Location: I watch gay porn
Contact:

Post by €M4NU€L »

locobans wrote:
€M4NU€L wrote:

Code: Select all

   sType = 10; // Energy-Bolt
    SendEventToNearClient_TypeB(MSGID_EVENT_COMMON, DEF_COMMONTYPE_MAGIC, m_pClientList[iClientH]->m_cMapIndex, sX, sY, dX, dY, (sType+100), m_pClientList[iClientH]->m_sType);

Code: Select all

sType = 10; // Energy-Bolt
You can change the 10 for other number and it throws other Sprite =) but right now i dont want  to post the Numbers =P
Are you sure???????? OMFG!!!! THANKS A LOT I DIDIN'T KNEW THAT PARTTTTTTTTTTT :blink:
Well now you know Locobans :P
<span style='color:blue'>Helbreath Thermal</span> <span style='color:green'>BETA</span> <span style='color:red'>Soon</span>:<br><br>www.youporngay.com<br><br><img src='http://img264.imageshack.us/img264/1041 ... piopk7.jpg' border='0' alt='user posted image' /><br><img src='http://img257.imageshack.us/img257/3762 ... eakxj1.jpg' border='0' alt='user posted image' /><br><img src='http://arthur.crepin.free.fr/images/use ... mpsons.png' border='0' alt='user posted image' /><br><img src='http://img329.imageshack.us/img329/5797/pesgamerrr3.gif' border='0' alt='user posted image' /><br><br><u><b>BLACK GAY LIST:</b></u><br><br><span style='color:red'>€M4NU€L</span>:<br>I look like a girl and he's always complaining someone.
€M4NU€L
Outpost bitch
Posts: 517
Joined: Sat Nov 19, 2005 9:07 pm
Location: I watch gay porn
Contact:

Post by €M4NU€L »

Hey one problem that i have is this one i can't find this CODE in Client.cpp !!

Client.cpp
Function: iClientMotion_Attack_Handler
Find

Code: Select all

if (sOwner != NULL) {
 if ((wType != 0) && ((dwTime - m_pClientList[iClientH]->m_dwRecentAttackTime) > 100)) { 
  if ((m_pClientList[iClientH]->m_pIsProcessingAllowed == FALSE) && (m_pClientList[iClientH]->m_bIsInsideWarehouse == FALSE) 
   && (m_pClientList[iClientH]->m_bIsInsideWizardTower == FALSE) && (m_pClientList[iClientH]->m_bIsInsideOwnTown == FALSE)) {

<span style='color:blue'>Helbreath Thermal</span> <span style='color:green'>BETA</span> <span style='color:red'>Soon</span>:<br><br>www.youporngay.com<br><br><img src='http://img264.imageshack.us/img264/1041 ... piopk7.jpg' border='0' alt='user posted image' /><br><img src='http://img257.imageshack.us/img257/3762 ... eakxj1.jpg' border='0' alt='user posted image' /><br><img src='http://arthur.crepin.free.fr/images/use ... mpsons.png' border='0' alt='user posted image' /><br><img src='http://img329.imageshack.us/img329/5797/pesgamerrr3.gif' border='0' alt='user posted image' /><br><br><u><b>BLACK GAY LIST:</b></u><br><br><span style='color:red'>€M4NU€L</span>:<br>I look like a girl and he's always complaining someone.
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

€M4NU€L wrote: Hey one problem that i have is this one i can't find this CODE in Client.cpp !!

Client.cpp
Function: iClientMotion_Attack_Handler
Find

Code: Select all

if (sOwner != NULL) {
 if ((wType != 0) && ((dwTime - m_pClientList[iClientH]->m_dwRecentAttackTime) > 100)) { 
  if ((m_pClientList[iClientH]->m_pIsProcessingAllowed == FALSE) && (m_pClientList[iClientH]->m_bIsInsideWarehouse == FALSE) 
   && (m_pClientList[iClientH]->m_bIsInsideWizardTower == FALSE) && (m_pClientList[iClientH]->m_bIsInsideOwnTown == FALSE)) {
2.24b?
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
€M4NU€L
Outpost bitch
Posts: 517
Joined: Sat Nov 19, 2005 9:07 pm
Location: I watch gay porn
Contact:

Post by €M4NU€L »

Dax wrote:
€M4NU€L wrote: Hey one problem that i have is this one i can't find this CODE in Client.cpp !!

Client.cpp
Function: iClientMotion_Attack_Handler
Find

Code: Select all

if (sOwner != NULL) {
 if ((wType != 0) && ((dwTime - m_pClientList[iClientH]->m_dwRecentAttackTime) > 100)) { 
  if ((m_pClientList[iClientH]->m_pIsProcessingAllowed == FALSE) && (m_pClientList[iClientH]->m_bIsInsideWarehouse == FALSE) 
   && (m_pClientList[iClientH]->m_bIsInsideWizardTower == FALSE) && (m_pClientList[iClientH]->m_bIsInsideOwnTown == FALSE)) {
2.24b?
Crap 2.24c :lol:
<span style='color:blue'>Helbreath Thermal</span> <span style='color:green'>BETA</span> <span style='color:red'>Soon</span>:<br><br>www.youporngay.com<br><br><img src='http://img264.imageshack.us/img264/1041 ... piopk7.jpg' border='0' alt='user posted image' /><br><img src='http://img257.imageshack.us/img257/3762 ... eakxj1.jpg' border='0' alt='user posted image' /><br><img src='http://arthur.crepin.free.fr/images/use ... mpsons.png' border='0' alt='user posted image' /><br><img src='http://img329.imageshack.us/img329/5797/pesgamerrr3.gif' border='0' alt='user posted image' /><br><br><u><b>BLACK GAY LIST:</b></u><br><br><span style='color:red'>€M4NU€L</span>:<br>I look like a girl and he's always complaining someone.
Windy
Member
Posts: 157
Joined: Tue Nov 18, 2003 8:31 am
Location: wishing I was somewhere else

Post by Windy »

damn I was thinking about making a sword that casted MS on stuff when u attacked and I was hoping it was gonna be like original and stuff but now this code is released =/ damn....well I guess it saves me alot of work...
<span style='color:blue'>Coding with Evil Intentions....Evil at its Best....</span>
mikus
Regular
Posts: 33
Joined: Thu Feb 23, 2006 1:56 pm

Post by mikus »

Hi on what surces it working i serch this line iClientMotion_Attack_Handler on 2,24b and on 2,24c and nothing ;/
HelbreatH Fuck The Future
theblue2
noob
Posts: 28
Joined: Tue Sep 06, 2005 1:42 pm

Post by theblue2 »


thanks.

Image

Image

Image
Windy
Member
Posts: 157
Joined: Tue Nov 18, 2003 8:31 am
Location: wishing I was somewhere else

Post by Windy »

lol now time to see if people can figure out how to change the energybolt effect lol...so that they arnt limited to smaller spells or bigger spells with gay effects added to them lol but I love the code and Im glad that not everybody knows how to change the other effects
<span style='color:blue'>Coding with Evil Intentions....Evil at its Best....</span>
Post Reply