Jump to content
  • 0
vijay

About getitem

Question

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.

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

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

Share this post


Link to post
Share on other sites
  • 0
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:
[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:

 

getitem Apple, 1, .@guildMasterAccId;
 
To
getitem 512, 1, .@guildMasterAccId; //apple 

 
Thanks a lot :)

Share this post


Link to post
Share on other sites
  • 0
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

Share this post


Link to post
Share on other sites

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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.