Explorar o código

Minor cleanup of riding script commands.
- The 'checkriding()' function no longer checks for wargs and dragons, ONLY Pecos, Grand Pecos, and Gryphons (as documented). (bugreport:9024)
http://rathena.org/board/tracker/issue-9024-about-renters-from-rathenanpcremerchants/
- Replaced 'checkoption()' warg checks with 'checkwug()'.

Signed-off-by: Euphy <euphy.raliel@rathena.org>

Euphy %!s(int64=11) %!d(string=hai) anos
pai
achega
5e261ba415

+ 8 - 8
doc/script_commands.txt

@@ -4501,8 +4501,8 @@ database. If the name is not found, nothing will be deleted.
 *storagedelitem <item id>,<amount>{,<account ID>};
 *storagedelitem "<item name>",<amount>{,<account ID>};
 
-Same like delitem, but deletes item from cart or storage.
-If cart is not mounted, it will be failed.
+This command behaves identically to 'delitem', but deletes items from the player's
+cart or storage. If no cart is mounted, 'cartdelitem' will fail.
 
 ---------------------------------------
 
@@ -4519,8 +4519,8 @@ See 'getitem2' for an explanation of the expanded parameters.
 *storagedelitem2 <item id>,<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
 *storagedelitem2 "<item name>",<amount>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>{,<account ID>};
 
-Same like delitem2, but deletes item from cart or storage.
-If cart is not mounted, it will be failed.
+This command behaves identically to 'delitem2', but deletes items from the player's
+cart or storage. If no cart is mounted, 'cartdelitem2' will fail.
 
 ---------------------------------------
 
@@ -4551,8 +4551,8 @@ adding up strings:
 *storagecountitem(<item id>)
 *storagecountitem("<item name>")
 
-Same like countitem, but counts item from cart or storage.
-If cart is not mounted, -1 will be returned.
+This command behaves identically to 'countitem', but counts items from the player's
+cart or storage. If no cart is mounted, 'cartcountitem' will return -1.
 
 ---------------------------------------
 
@@ -4572,8 +4572,8 @@ See 'getitem2' for an explanation of the expanded parameters.
 *storagecountitem2(<item id>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>)
 *storagecountitem2("<item name>",<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>)
 
-Same like countitem2, but counts item from cart or storage.
-If cart is not mounted, -1 will be returned.
+This command behaves identically to 'countitem2', but counts items from the player's
+cart or storage. If no cart is mounted, 'cartcountitem2' will return -1.
 
 ---------------------------------------
 

+ 3 - 3
npc/custom/breeder.txt

@@ -15,7 +15,7 @@ prontera,124,201,1	script	Universal Rental NPC	726,{
 		message strcharinfo(0),"You must first remove your mount.";
 		end;
 	} else if ((eaclass()&EAJ_THIRDMASK==EAJ_RANGER) && !countitem(6124)) {
-		if (!checkfalcon() && getskilllv("HT_FALCON") && !checkoption(Option_Wug) && !checkoption(Option_Wugrider)) {
+		if (!checkfalcon() && getskilllv("HT_FALCON") && !checkwug()) {
 			if(select(" ~ Falcon: ~ Warg")==1) setfalcon;
 			else getitem 6124,1; //Wolf's_Flute
 		} else getitem 6124,1; //Wolf's_Flute
@@ -25,8 +25,8 @@ prontera,124,201,1	script	Universal Rental NPC	726,{
 			else setmadogear;
 		} else setcart;
 	} else if (!checkcart() && getskilllv("MC_PUSHCART")) setcart;
-	else if (!checkfalcon() && getskilllv("HT_FALCON") && !checkoption(Option_Wug) && !checkoption(Option_Wugrider)) setfalcon;
-	else if (!checkriding() && getskilllv("KN_RIDING")) {
+	else if (!checkfalcon() && getskilllv("HT_FALCON") && !checkwug()) setfalcon;
+	else if (!checkriding() && !checkdragon() && getskilllv("KN_RIDING")) {
 		if (eaclass()&EAJ_THIRDMASK==EAJ_RUNE_KNIGHT) setdragon;
 		else setriding;
 	} else if (!checkmadogear() && getskilllv("NC_MADOLICENCE")) setmadogear;

+ 2 - 2
npc/merchants/renters.txt

@@ -162,7 +162,7 @@ hu_in01,381,304,5	script	Falcon Breeder#hnt	105,{
 
 	mes "[Falcon Breeder]";
 	if (BaseJob == Job_Hunter) {
-		if (checkoption(Option_Wug) || checkoption(Option_Wugrider)) {
+		if (checkwug()) {
 			mes "Um...";
 			mes "You can't rent a Falcon";
 			mes "until you dismiss your warg first!";
@@ -175,7 +175,7 @@ hu_in01,381,304,5	script	Falcon Breeder#hnt	105,{
 		next;
 		switch(select("Rent Falcon:Cancel")) {
 		case 1:
-			if (checkoption(Option_Wug) || checkoption(Option_Wugrider)) {
+			if (checkwug()) {
 				mes "[Falcon Breeder]";
 				mes "Um...";
 				mes "You can't rent a Falcon";

+ 1 - 1
npc/other/turbo_track.txt

@@ -4602,7 +4602,7 @@ OnTouch:
 		mes "things using the Kafra Service.^000000";
 		close;
 	}
-	if ((BaseJob == Job_Knight || BaseJob == Job_Crusader) && checkriding()) {
+	if ((BaseJob == Job_Knight || BaseJob == Job_Crusader) && (checkriding() || checkdragon())) {
 		if (MaxWeight-Weight < 20000) {
 			if (!(eaclass()&EAJL_THIRD)) {
 				set .@mount$,(BaseJob == Job_Knight)?"Peco Peco":"Grand Peco";

+ 6 - 6
npc/re/merchants/renters.txt

@@ -29,12 +29,12 @@ job3_rune01,88,62,5	script	Dragon Breeder	105,{
 				mes "Please learn how to ride a Dragon first.";
 				close;
 			}
-			else if (checkriding()) {
+			else if (checkdragon()) {
 				mes "[Dragon Breeder]";
 				mes "You already have a Dragon.";
 				close;
 			}
-			else if(ismounting()) {
+			else if (ismounting()) {
 				mes "[Dragon Breeder]";
 				mes "Please remove your cash mount.";
 				close;
@@ -67,12 +67,12 @@ prontera,130,213,5	script	Riding Creature Master	105,{
 				mes "Please learn how to ride a Dragon first.";
 				close;
 			}
-			else if (checkriding()) {
+			else if (checkdragon()) {
 				mes "[Riding Creature Master]";
 				mes "You already have a Dragon.";
 				close;
 			}
-			else if(ismounting()) {
+			else if (ismounting()) {
 				mes "[Riding Creature Master]";
 				mes "Please remove your cash mount.";
 				close;
@@ -90,7 +90,7 @@ prontera,130,213,5	script	Riding Creature Master	105,{
 		next;
 		switch(select("Yes:No")) {
 		case 1:
-			if(!getskilllv("KN_RIDING")) {
+			if (!getskilllv("KN_RIDING")) {
 				mes "[Riding Creature Master]";
 				mes "Please learn how to ride a Gryphon first.";
 				close;
@@ -100,7 +100,7 @@ prontera,130,213,5	script	Riding Creature Master	105,{
 				mes "You already have a Gryphon.";
 				close;
 			}
-			else if(ismounting()) {
+			else if (ismounting()) {
 				mes "[Riding Creature Master]";
 				mes "Please remove your cash mount.";
 				close;

+ 1 - 1
src/map/script.c

@@ -8806,7 +8806,7 @@ BUILDIN_FUNC(checkriding)
 	if( sd == NULL )
 		return 0;// no player attached, report source
 
-	if( pc_isriding(sd) || pc_isridingwug(sd) || pc_isridingdragon(sd) )
+	if( pc_isriding(sd) )
 		script_pushint(st, 1);
 	else
 		script_pushint(st, 0);