Jump to content
  • 0

Need help to make event card exchange to points


dungpt8782

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  02/21/14
  • Last Seen:  

Hi, i'm newbie,  i dont know alot of function to make custome NPC, so someone can help me to make this event please!


My idea is:


- Make NPC in somewhere,


- For every hour will announce  "I need rand(card), please trade with me to receive rand(1,3) points",bc_all,


- When players  bring that card to trade with NPC, they will receive points in announce;


 


Thank you for help.


Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  100
  • Topics Per Day:  0.03
  • Content Count:  333
  • Reputation:   7
  • Joined:  03/01/14
  • Last Seen:  

Change first line to your desired map, position, direction, display name and sprite id.

Change "CardEventPoints" to your desired variable name for the points. Add '##' as prefix if it should be accountwise instead of characterwise.

Add Card IDs to the blockedcards array like this:
setarray .blockedcards[0],4001,4002;

 

Couldn't test it myself, just report any errors it throws if you cannot fix them yourself.

mapname,x,y,direct	script	Name	id,{
	if (.game){
		mes .npcname$;
		if(countitem(.cardid) < 1){
			mes "You don't have my ^ff0000"+getitemname(.cardid)+"^000000!!";
			close;
			end;
		}
		mes "Oh you've brought me my ^ff0000"+getitemname(.cardid)+"^000000.";
		mes "Can I have it please?";
		if(select("Yes:No")==2){
			next;
			mes .npcname$;
			mes "Aww..";
			close;
			end;
		}
		next;
		mes .npcname$;
		mes "Woooow, thank you! Here are your "+.pointamount+" point(s)!";
		delitem .cardid,1;
		set CardEventPoints, CardEventPoints+.pointamount;
		set .game,0;
		close;
		end;
	}
	else{
		mes .npcname$;
		mes "Sorry, I don't need a card at the moment.";
		close;
		end;
	}
	end;
	
	L_start:
	OnMinute11:
		set .cardid, rand(4001,4453);	//card id ranges from 4001 to 4453
		for(set .@i, 0; .@i < getarraysize(.blockedcards); set .@i, .@i+1){
			if (.blockedcards[.@i] == .cardid){
				goto L_start;
				end;
			}
		}
		set .pointamount, rand(1,3);
		set .game,1;
		announce .npcname$+": I need a "+getitemname(.cardid)+".",0;
		end;
		
	OnInit:
		set .pointamount, 0;
		set .cardid, 0;
		set .npcname$,"Name";	//npc name
		setarray .blockedcards[0],0;	//add cards you don't want to happen here
		set .game,0;
		end;
}
Edited by Greyford
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  16
  • Reputation:   0
  • Joined:  02/21/14
  • Last Seen:  

Thank you Greyford, i will try and report here soon.

rand(4001,4453) 4001 - 4453 is all normal card ID yet?


prontera,155,86,4	script	vnRO	751,{
	if (.game){
		mes .npcname$;
		if(countitem(.cardid) < 1){
			mes "You don't have my ^ff0000"+getitemname(.cardid)+"^000000!!";
			close;
			end;
		}
		mes "Oh you've brought me my ^ff0000"+getitemname(.cardid)+"^000000.";
		mes "Can I have it please?";
		if(select("Yes:No")==2){
			next;
			mes .npcname$;
			mes "Aww..";
			close;
			end;
		}
		next;
		mes .npcname$;
		mes "Woooow, thank you! Here are your "+.pointamount+" Poring coin(s)!";
		delitem .cardid,1;
		getitem 7539,.pointamount; //get poring coin
	//	set CardEventPoints, CardEventPoints+.pointamount;
	//	set .game,0;
		close;
		end;
	}
	end;
	
	L_start:
	OnMinute24:
		set .cardid, rand(4001,4453);	//card id ranges from 4001 to 4453
		for(set .@i, 0; .@i < getarraysize(.blockedcards); set .@i, .@i+1){
			if (.blockedcards[.@i] == .cardid){
				goto L_start;
				end;
			}
		}
		set .pointamount, rand(1,3);
		set .game,1;
		announce .npcname$+": I need a "+getitemname(.cardid)+" for "+.pointamount+" Poring Coins .",0;
		end;
		
	OnInit:
		set .pointamount, 0;
		set .cardid, 0;
		set .npcname$,"vnRO";	//npc name
		setarray .blockedcards[0],0;	//add cards you don't want to happen here
		set .game,0;
		end;
}

This is my script i made follow you, it worked perfect.

I changed

- get point to get Poring Coin.

- Will unlimit exchange card to coin times.

- I still need set .game,0; OnInit?

 

Thank you for support!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  100
  • Topics Per Day:  0.03
  • Content Count:  333
  • Reputation:   7
  • Joined:  03/01/14
  • Last Seen:  

Oh, you want the event to run a whole hour so everyone can exchange their cards?

I thought you just want to reward the first one who brings the card, that's why I had the .game variable to check if there actually is a game or not.

 

You need to watch out then since when there comes an easy card people will just collect 100 and exchange them.

 

For the IDs check your item_db.txt in your db, db/pre-re or db/re folder (depending on what you run). 4001 - 4453 contains all pre-renewal cards including MvP Cards as far as I know.

Link to comment
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.   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.

×
×
  • Create New...