Jump to content
  • 0

Request for PCOnEquipEvent: & PCOnUnEquipEvent:


Question

12 answers to this question

Recommended Posts

Posted

by default...both event are implemented inside the item_db itself..

................{ Script },{ OnEquip_Script },{ OnUnequip_Script }
 

 

otherwise...you can try this too

damn ... I found some very interesting topic

attachicon.gifOnPCStatCalcEvent.patch

-    script    kjfhsdfkjhsd    -1,{
OnPCStatCalcEvent:
    if ( strcharinfo(3) == "prontera" ) // permanently increase 100 str as long as staying in prontera
        bonus bstr, 100;
    if ( strcharinfo(0) == "Annieruru" ) // permanently increase 200 agi if the player name Annieruru (me xD)
        bonus bagi, 200;
    end;
}
  • Upvote 1
Posted (edited)

thanks for the annie's quote info, you save my day!

 

thank you so much!

 

EDIT: ops, i think i'm wrong, tsk! i'm not test your annie patch but i look up into code, just only change stats when player load map or login/logout, just i need when i change equip, stats bonus + and unequip, stats bonus out!

 

someone can help me?

Edited by gintoki
Posted

just i need when i change equip, stats bonus + and unequip, stats bonus out!

 

just like what Emistry said, this would be enough. 

 

................{ Script },{ OnEquip_Script },{ OnUnequip_Script } 

 

 

 

Posted (edited)

well, that's the easiest way to do it.; 

 

put a callfunc inside the equip script / unequip script respectively.

 

open your item_db with your favorite text editor,

 

find 

},{},{}

 

and replace all with

 

},{ callfunc "whatscripttoexecutewhenequipping"; },{ callfunc "whatscripttoexecuteonunequipping"; }

 

and you're done. all you have to do is to write the script you want to execute. was that so hard?

Edited by Jhedzkie
Posted

O_o are you seriously gonna equip your potions? if that's your problem, then just copy the weapons and armors to another text file then do the replacing. you really need to put some effort to this.


konting utak naman kapatid.

Posted

do you want to use it like another MMORPGs that have quest 'to use equip' then 'put off the equip', and check which equipment is equipped and put off..?

Posted

do you want to use it like another MMORPGs that have quest 'to use equip' then 'put off the equip', and check which equipment is equipped and put off..?

 

yes, can you do it for me please?

Posted (edited)

use for my weapon level up system, this label combo with sql check and give certain bonus to player if weapon level > 1

 

like this:

 

	OnPCEquipEvent:
	OnPCLoginEvent: // -- Check Login too
	set .@wid, getequipid(4); set .@f, getcharid(0); if( !.@wid ) end;
	query_sql "SELECT `str`,`agi`,`vit`,`int`,`dex`,`luk` FROM `inventory` WHERE `char_id` = '"+.@f+"' AND `nameid` = '"+.@wid+"'  AND `equip` > 0 && `equip` != 32",.@str,.@agi,.@vit,.@int,.@dex,.@luk;
	if( BaseJob == Job_Assassin || BaseJob == Job_Kagerou || BaseJob == Job_Oboro ) { if( getequipweaponlv(3) > 0 )
	query_sql "SELECT `str`,`agi`,`vit`,`int`,`dex`,`luk` FROM `inventory` WHERE `char_id` = '"+.@f+"' AND `nameid` = '"+.@wid+"'  AND `equip` == 32",.@str1,.@agi1,.@vit1,.@int1,.@dex1,.@luk1; }
	if( (.@str || .@agi || .@vit || .@int || .@dex || .@luk || .@str || .@agi1 || .@vit1 || .@int1 || .@dex1 || .@luk1) > 0 )
	atcommand "@power 1 "+.@str+.@str1+" "+.@agi+.@agi1+" "+.@vit+.@vit1+" "+.@int+.@int1+" "+.@dex+.@dex1+" "+.@luk+.@luk1+"";
	end;
	
	OnPCUnequipEvent:
	atcommand "@power 0"; // -- When player take of equip, bonus out, prevent bare hand exploit!
	end;

i can create this label for myself too, but i'm not good at source, i'm not sure if i create... server may be crash :( and i need some one help me solve my problem.

 

so, special thanks to you Cydh

 

sorry for my bad english again T_T

Edited by gintoki

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...