Jump to content
  • 0

Question

Posted

So I've found this poring Invasion, i was wondering if there we're a way, to make a count-able point shop for it? Where they could use the points. For example: Each poring killed = 1 Point. Shop : Headgear = 10 points. etc.

 

Script:

//===== rAthena Script =======================================
//= Poring Summoner
//===== By: ==================================================
//= Bahmut (Made it automated)
//= MoonlightRO (Original)
//===== Current Version: =====================================
//= 1.4
//===== Compatible With: =====================================
//= TXT & SQL
//===== Link to orginal: =====================================
//= [url="http://www.eathena.ws/board/index.php?showtopic=236779"]http://www.eathena.w...howtopic=236779[/url]
//============================================================
-	script	Poring Summoner	-1,{
OnInit:
	//---- NPC Config -----
	set .SpecialPorings,100;
	set .NormalPorings,0;
	//---------------------
	initnpctimer;
	end;
 
OnSpecialKill:
	set .SpecialPorings[1],.SpecialPorings[1]-1;
	announce strcharinfo(0) + " got a " + getitemname(.ItemID) + "!",bc_map;
//	getitem .ItemID,1;
	set PoringPoint,PoringPoint+1;
	dispbottom "You got 1 Poring Point";
	dispbottom "Total Poring Points:"+PoringPoint;
	goto PoringCount;
 
OnNormalKill:
	set .NormalPorings[1],.NormalPorings[1]-1;
	goto PoringCount;
 
PoringCount:
	announce "Special Poring: " + .SpecialPorings[1] + " || Normal Poring: " + .NormalPorings[1],bc_map;
	if(!.SpecialPorings[1]) goto EndEvent;
	end;
 
OnClock1200:
OnClock1600:
OnClock2000:
OnClock0000:
OnClock0400:
OnClock0800:

RestartEvent:
	set .Event,0;
	set .SpecialPorings[1],0;
	set .NormalPorings[1],0;
	
	removemapflag .Map$,mf_noskill;
	set $@ran, rand(1,9);
	if ($@ran == 9) set .Map$,"lighthalzen";
	if ($@ran == 8) set .Map$,"louyang";
	if ($@ran == 7) set .Map$,"comodo";
	if ($@ran == 6) set .Map$,"xmas";
	if ($@ran == 5) set .Map$,"aldebaran";
	if ($@ran == 4) set .Map$,"payon";
	if ($@ran == 3) set .Map$,"geffen";
	if ($@ran == 2) set .Map$,"morocc";
	if ($@ran == 1) set .Map$,"prontera";
	killmonster .Map$,"All";
	setmapflag .Map$,mf_noskill;
	monster .Map$,0,0,"Poring",1002,.SpecialPorings,"Poring Summoner::OnSpecialKill";
	monster .Map$,0,0,"Poring",1002,.NormalPorings,"Poring Summoner::OnNormalKill";
	set .SpecialPorings[1],.SpecialPorings;
	set .NormalPorings[1],.NormalPorings;
	announce "The Poring Event has begun!",bc_all;
	announce "Location: " + .Map$,bc_all;
	announce "Special Poring: " + .SpecialPorings,bc_all;
	announce "Normal Poring: " + .NormalPorings,bc_all;
 
	setnpctimer 0;
	close;

EndEvent:
	if(.Event) announce "The Poring Summon Event is now over!",bc_all;
	killmonster .Map$,"All";
	set .Event,0;
	set .SpecialPorings[1],0;
	set .NormalPorings[1],0;
	end;
}

Thanks for checking this out, Shio.

2 answers to this question

Recommended Posts

Posted
OnSpecialKill:
	set .SpecialPorings[1],.SpecialPorings[1]-1;
	announce strcharinfo(0) + " got a " + getitemname(.ItemID) + "!",bc_map;
//	getitem .ItemID,1;
	set PoringPoint,PoringPoint+1;
	dispbottom "You got 1 Poring Point";
	dispbottom "Total Poring Points:"+PoringPoint;
	goto PoringCount;

On that part of the script, edit this part :

	set PoringPoint,PoringPoint+1;

to

	set #PoringPoint,#PoringPoint+1;

Since using the # sign is to make the variable eligible to be used by the whole account.

 

 

And as for the shop, just use any Dynamic shops that uses variables as a currency like Emistry's Multi-Currency Shop.

Link : http://rathena.org/board/topic/68468-utility-multi-currency-shop/

 

Please kindly press the green UP button if it helped. Thanks.

  • Upvote 1
Posted (edited)

Haven't tested it

//===== rAthena Script =======================================
//= Poring Summoner
//===== By: ==================================================
//= Bahmut (Made it automated)
//= MoonlightRO (Original)
//===== Current Version: =====================================
//= 1.4
//===== Compatible With: =====================================
//= TXT & SQL
//===== Link to orginal: =====================================
//= [url="http://www.eathena.ws/board/index.php?showtopic=236779"]http://www.eathena.w...howtopic=236779[/url]
//============================================================
-	script	Poring Summoner	-1,{
OnInit:
	//---- NPC Config -----
	set .SpecialPorings,100;
	set .NormalPorings,0;
	//---------------------
	initnpctimer;
	end;
 
OnSpecialKill:
	set .SpecialPorings[1],.SpecialPorings[1]-1;
	announce strcharinfo(0) + " killed a special poring!",bc_map;
	set PoringPoint,PoringPoint+1;
	dispbottom "You got 1 Poring Point";
	dispbottom "Total Poring Points: "+PoringPoint;
	goto PoringCount;
 
OnNormalKill:
	set .NormalPorings[1],.NormalPorings[1]-1;
	goto PoringCount;
 
PoringCount:
	announce "Special Poring: " + .SpecialPorings[1] + " || Normal Poring: " + .NormalPorings[1],bc_map;
	if(!.SpecialPorings[1]) goto EndEvent;
	end;
 
OnClock1200:
OnClock1600:
OnClock2000:
OnClock0000:
OnClock0400:
OnClock0800:

RestartEvent:
	set .Event,0;
	set .SpecialPorings[1],0;
	set .NormalPorings[1],0;

	removemapflag .Map$,mf_noskill;
	set $@ran, rand(1,9);
	if ($@ran == 9) set .Map$,"lighthalzen";
	if ($@ran == 8) set .Map$,"louyang";
	if ($@ran == 7) set .Map$,"comodo";
	if ($@ran == 6) set .Map$,"xmas";
	if ($@ran == 5) set .Map$,"aldebaran";
	if ($@ran == 4) set .Map$,"payon";
	if ($@ran == 3) set .Map$,"geffen";
	if ($@ran == 2) set .Map$,"morocc";
	if ($@ran == 1) set .Map$,"prontera";
	killmonster .Map$,"All";
	setmapflag .Map$,mf_noskill;
	monster .Map$,0,0,"Poring",1002,.SpecialPorings,"Poring Summoner::OnSpecialKill";
	monster .Map$,0,0,"Poring",1002,.NormalPorings,"Poring Summoner::OnNormalKill";
	set .SpecialPorings[1],.SpecialPorings;
	set .NormalPorings[1],.NormalPorings;
	announce "The Poring Event has begun in "+.Map$+"!",bc_all; 
	setnpctimer 0;
	close;

EndEvent:
	if(.Event) announce "The Poring Summon Event is now over!",bc_all;
	killmonster .Map$,"All";
	set .Event,0;
	set .SpecialPorings[1],0;
	set .NormalPorings[1],0;
	end;
}

-	shop	PoringEventShop Shop	-,501:2000000000;
izlude,155,200,3	script	Poring Event Shop	51,{
	//---------------------
	setarray .item[0],4003,4004;
	set .prize[4003],100;
	set .prize[4004],150;
	//---------------------
	for(set .i,0; .i<getarraysize(.item) ; set .i,.i+1) {
		if(.i == 0) {
			npcshopitem "PoringEventShop",.item[.i],.prize[.item[.i]];
		} else {
			npcshopadditem "PoringEventShop",.item[.i],.prize[.item[.i]];
		}
	}
	//---------------------
	mes "[Poring Event Shop]";
	mes "Items are paid in Poring Event Points.";
	mes "Poring Points: "+PoringPoint+"";
	npcshopattach "PoringEventShop";
	callshop "PoringEventShop",1;
	close;

	OnBuyItem:
		for(set @i,0; @i < getarraysize(@bought_nameid); set @i,@i+1) {
			set @prize,@bought_quantity[@i]*.prize[@bought_nameid[@i]];
			if(PoringPoint >= @prize) {
				if (checkweight(@bought_nameid[@i],@bought_quantity[@i])) {
					set PoringPoint,PoringPoint-@prize;
					getitem @bought_nameid[@i],@bought_quantity[@i];
				} else {
					dispbottom "You can't hold "+@bought_quantity[@i]+"x "+getitemname(@bought_nameid[@i])+".";
				}
			} else {
				dispbottom "You don't have enough Poring Points to buy "+getitemname(@bought_nameid[@i])+".";
			}

		}
	end;
}

Edited by Pascal S
  • Upvote 1

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