About getitem

vijay

New member
Messages
76
Points
0
Age
33
Location
Bangalore, India.
Emulator
Hello everyone!
I'm requesting for a npc script which getitem to the guild leader as soon as the WOE is over.
The npc must only check for the active castle and then it must getitem.
ex: prtg_cas01 is the only castle activated for WOE so the npc must check who owns that castle and then it much getitem to the respective guild leader when the WOE ends.

~Thanks.

 
You can use something like that:

- script WoePrize -1,{ OnAgitEnd: OnAgit2End: .@castleMap$ = "prtg_cas01"; .@guildId = getcastledata(.@castleMap$, 1); .@guildMasterId = getguildmasterid(.@guildId); query_sql("SELECT `account_id` FROM `char` WHERE `char_id` = " + .@guildMasterId, .@guildMasterAccId); getitem Apple, 1, .@guildMasterAccId; end;}
But it will give the item to any character logged in the guild master account (not necessarily the guild master), and if the guild master is not online in any of his characters, this will not work, you'll have to store it somewhere and give it when he logs in.

Maybe with attachrid you can get some better results by checking if the player is online as the guild master and if not do something different.

Hope it helps

 
Thanks KirieZ will try that as soon as i get home
default_biggrin.png


 
Scirpt i managed to port it to work on eAthena 3CeAm.
 
- script WoePrize -1,{ OnAgitEnd:OnAgit2End://.@castleMap$ = "prtg_cas01";set .@castleMap$, "prtg_cas01"; set .@guildId, getcastledata(.@castleMap$, 1);set .@guildMasterId, getguildmasterid(.@guildId); query_sql("SELECT `account_id` FROM `char` WHERE `char_id` = " + .@guildMasterId, .@guildMasterAccId); getitem Apple, 1, .@guildMasterAccId;end;}
 
Error:
Code:
[Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: getitem (3 parameters):[Debug]: Data: variable name='Apple'[Debug]: Data: number value=1[Debug]: Data: variable name='.@guildMasterAccId' index=0[Debug]: Source (NPC): WoePrize (invisible/not on a map)[Warning]: script:get_val: cannot access player variable 'Apple', defaulting to0[Error]: buildin_getitem: Nonexistant item 0 requested.[Debug]: Source (NPC): WoePrize (invisible/not on a map)
Fixed, changed:

Code:
getitem Apple, 1, .@guildMasterAccId;
 
To
Code:
getitem 512, 1, .@guildMasterAccId; //apple 
 
@@KirieZ
Thanks a lot
default_smile.png

 
getitem Apple, 1, .@guildMasterAccId; 
Change Apple to Any ItemID you want..

eAthena don't support itemNames as constants, so you need to use ItemID's

 
Back
Top