Minor edits and follow-ups.
Signed-off-by: Euphy <euphy.raliel@rathena.org>
This commit is contained in:
parent
8115dc048a
commit
5a1f3f95c4
@ -3,7 +3,7 @@
|
||||
//===== By: ==================================================
|
||||
//= rAthena Dev Team
|
||||
//===== Last Updated: ========================================
|
||||
//= 20130827
|
||||
//= 20140123
|
||||
//===== Description: =========================================
|
||||
//= List of available atcommands and their functions.
|
||||
//============================================================
|
||||
@ -856,9 +856,10 @@ Changes the specified stat of your character.
|
||||
|
||||
---------------------------------------
|
||||
|
||||
@allstats
|
||||
@allstats {<+/- amount>}
|
||||
|
||||
Sets all stats to the maximum (default is 99).
|
||||
Changes all stats of your character.
|
||||
If no amount is given, sets all stats to the maximum (default is 99).
|
||||
|
||||
---------------------------------------
|
||||
|
||||
@ -1051,15 +1052,16 @@ Example:
|
||||
|
||||
@fullstrip <player name>
|
||||
|
||||
Unequip all item from a player.
|
||||
Unequip all items from a player.
|
||||
|
||||
---------------------------------------
|
||||
|
||||
@cart <0-%d>
|
||||
@cart <cart ID>
|
||||
|
||||
Give or remove a cart to a player and also change the cart skin.
|
||||
0 = remove cart
|
||||
x = cart color
|
||||
Give or remove a cart to a player and also change the cart skin based on ID:
|
||||
0: remove cart
|
||||
1-5: normal carts
|
||||
6-9: new carts (available for PACKETVER >= 20120201)
|
||||
|
||||
---------------------------------------
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
//===== By: ==================================================
|
||||
//= Kisuka
|
||||
//===== Current Version: =====================================
|
||||
//= 1.1a
|
||||
//= 1.1b
|
||||
//===== Compatible With: =====================================
|
||||
//= rAthena Project
|
||||
//===== Description: =========================================
|
||||
@ -12,11 +12,18 @@
|
||||
//= 1.0 First version. [Kisuka]
|
||||
//= 1.1 Added Catalog Magician. [Euphy]
|
||||
//= 1.1a Moved Catalog Magician to Renewal path. [Euphy]
|
||||
//= 1.1b Added missing weight checks. [Euphy]
|
||||
//============================================================
|
||||
|
||||
// Black Marketeer (Buy Licenses - Non-Merchant Classes)
|
||||
// Black Marketeer (Buy Licenses - Non-Merchant Classes) :: qskill_buy_store
|
||||
//============================================================
|
||||
que_job01,68,84,1 script Black Marketeer#Buying 881,{
|
||||
if (checkweight(1201,1) == 0 || MaxWeight - Weight < 2400) {
|
||||
mes "[Mr. Jass]";
|
||||
mes "You're too greedy, even compared to someone like me!";
|
||||
mes "Why don't you go lighten your bag first?";
|
||||
close;
|
||||
}
|
||||
if (getskilllv("ALL_BUYING_STORE") == 1) {
|
||||
mes "[Mr. Jass]";
|
||||
mes "Hey, you already made a contract with Hugh.";
|
||||
@ -63,7 +70,7 @@ que_job01,68,84,1 script Black Marketeer#Buying 881,{
|
||||
mes "Ha... Ha ha ha!";
|
||||
mes "Mr. Hugh, I'll take over your license business. You'll see!";
|
||||
mes "*Giggle Giggle*";
|
||||
getitem 12548,.@input; //Shabby_Purchase_Street
|
||||
getitem 12548,.@input; //Buy_Market_Permit2
|
||||
set Zeny,Zeny-(.@input*500);
|
||||
}
|
||||
close;
|
||||
@ -95,6 +102,10 @@ que_job01,68,84,1 script Black Marketeer#Buying 881,{
|
||||
// Purchasing Team (Learn Skill - Merchant Classes)
|
||||
//============================================================
|
||||
alberta_in,58,52,4 script Purchasing Team#Buying 59,{
|
||||
if (checkweight(1201,1) == 0 || MaxWeight - Weight < 2400) {
|
||||
mes "- You cannot converse or perform the quest because you are carrying too many items. -";
|
||||
close;
|
||||
}
|
||||
mes "[Mr. Hugh]";
|
||||
if (BaseClass == Job_Merchant && getskilllv("MC_VENDING") >= 1) {
|
||||
if (getskilllv("ALL_BUYING_STORE") == 1) {
|
||||
@ -127,7 +138,7 @@ alberta_in,58,52,4 script Purchasing Team#Buying 59,{
|
||||
mes "but you don't seem to have enough money.";
|
||||
} else {
|
||||
mes "Thank you for your patronage.";
|
||||
getitem 6377,.@input; //Buy_Stall_Permit
|
||||
getitem 6377,.@input; //Buy_Market_Permit
|
||||
set Zeny,Zeny-(.@input*200);
|
||||
}
|
||||
close;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// --------------------------------------------------------------
|
||||
// - Tests Scripts -
|
||||
// --------------------------------------------------------------
|
||||
// Thoses scripts are meant for regression test purposes
|
||||
// These scripts are meant for regression test purposes.
|
||||
|
||||
npc: npc/test/OnInterInit.txt
|
||||
npc: npc/test/npc_test_checkweight.txt
|
||||
|
@ -1,3 +1,13 @@
|
||||
//===== rAthena Script =======================================
|
||||
//= Test: OnInterInit
|
||||
//===== By: ==================================================
|
||||
//= rAthena Dev Team
|
||||
//===== Last Updated: ========================================
|
||||
//= 20140109
|
||||
//===== Description: =========================================
|
||||
//= Tests 'OnInterIfInit' and 'OnInterIfInitOnce' labels.
|
||||
//============================================================
|
||||
|
||||
- script OnInterChk -1,{
|
||||
OnInterIfInit:
|
||||
debugmes "Loaded OnInterIfInit <-------";
|
||||
|
@ -1,11 +1,11 @@
|
||||
//===== rAthena Script =======================================
|
||||
//= Sample: CheckWeight
|
||||
//= Test: Checkweight
|
||||
//===== By: ==================================================
|
||||
//= rAthena Dev Team
|
||||
//===== Last Updated: ========================================
|
||||
//= 20121113
|
||||
//= 20140123
|
||||
//===== Description: =========================================
|
||||
//= Demonstrates 'checkweight' command.
|
||||
//= Tests 'checkweight' and 'checkweight2' commands.
|
||||
//============================================================
|
||||
|
||||
prontera,161,181,6 script ChkSpace 763,{
|
||||
@ -20,163 +20,159 @@ L_RESET:
|
||||
delitem(@inventorylist_id[.@i],@inventorylist_amount[.@i]); //clear inventory
|
||||
}
|
||||
|
||||
|
||||
L_TEST1: //basic backward chk
|
||||
.@testid = 0;
|
||||
.@succes = 0;
|
||||
.@success = 0;
|
||||
.@ret = checkweight(512,10);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
set .@success,.@success+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
.@ret = checkweight("Apple",10);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
set .@success,.@success+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
.@ret = checkweight(6320,33000);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure too many item amount item weight=0
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure too many item amount item weight=0
|
||||
.@ret = checkweight("Premium_Reset_Stone",33000);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure too many item amount
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure too many item amount
|
||||
.@ret = checkweight(717,500);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success weight based on max weight=2030
|
||||
set .@success,.@success+ChkResult(.@testid++,1,.@ret); //should be success weight based on max weight=2030
|
||||
.@ret = checkweight(717,1000);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure weight based on max weight=2030
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure weight based on max weight=2030
|
||||
.@ret = checkweight(2794,100);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
set .@success,.@success+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
.@ret = checkweight(2794,101);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure (with MAX_INVENTORY = 100)
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure (with MAX_INVENTORY = 100)
|
||||
.@ret = checkweight(-1,1);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure invalide item id
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure invalid item id
|
||||
.@ret = checkweight(512,0);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure invalide amount
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure invalid amount
|
||||
|
||||
debugmes "End backward test";
|
||||
FinalReport(.@testid,.@succes);
|
||||
|
||||
FinalReport(.@testid,.@success);
|
||||
|
||||
L_TEST2: //update using list test
|
||||
.@testid = 0;
|
||||
.@succes = 0;
|
||||
.@success = 0;
|
||||
|
||||
.@ret = checkweight(512,10,513,10);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
set .@success,.@success+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
.@ret = checkweight("Apple",10,"Banana",10);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
set .@success,.@success+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
.@ret = checkweight(512,80,513,33000);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure
|
||||
.@ret = checkweight("Apple",80,"Banana",33000);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure too many item amount
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure too many item amount
|
||||
.@ret = checkweight("Apple",10,"Banana",21,512);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure invalid nb of args
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure invalid nb of args
|
||||
.@ret = checkweight(717,500,716,100);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be succes weight 1800/2030
|
||||
set .@success,.@success+ChkResult(.@testid++,1,.@ret); //should be succes weight 1800/2030
|
||||
.@ret = checkweight(717,500,716,500);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure weight 3000/2030
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure weight 3000/2030
|
||||
.@ret = checkweight(2794,95,2795,5);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
set .@success,.@success+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
.@ret = checkweight(2794,95,2795,10);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure (with MAX_INVENTORY = 100)
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure (with MAX_INVENTORY = 100)
|
||||
.@ret = checkweight(512,1,-1,1);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure invalide item id
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure invalid item id
|
||||
.@ret = checkweight(512,1,513,0);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure invalide amount
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure invalid amount
|
||||
.@ret = checkweight(6320,31000,6320,2000);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure overamount inventory
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure overamount inventory
|
||||
.@ret = checkweight(512,1,513,1,514,1,515,1);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be sucess
|
||||
set .@success,.@success+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
|
||||
debugmes "End update by list tests";
|
||||
FinalReport(.@testid,.@succes);
|
||||
FinalReport(.@testid,.@success);
|
||||
|
||||
L_TEST3: //update using array tests
|
||||
.@testid = 0;
|
||||
.@succes = 0;
|
||||
.@success = 0;
|
||||
|
||||
setarray .@item[0], 512,513,514,515;
|
||||
setarray .@count[0], 1,5,9,12;
|
||||
.@ret = checkweight2(.@item,.@count);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be sucess
|
||||
set .@success,.@success+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
|
||||
cleararray .@item[0], 0, 4;
|
||||
cleararray .@count[0], 0, 4;
|
||||
setarray .@item[0], 512,513,514,515;
|
||||
setarray .@count[0], 1,5,-1,12;
|
||||
.@ret = checkweight2(.@item,.@count);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure, invalide amout
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure, invalid amount
|
||||
|
||||
cleararray .@item[0], 0, 4;
|
||||
cleararray .@count[0], 0, 4;
|
||||
setarray .@item[0], 512,513,514,-1;
|
||||
setarray .@count[0], 1,5,15,12;
|
||||
.@ret = checkweight2(.@item,.@count);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure, invalide id
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure, invalid id
|
||||
|
||||
cleararray .@item[0], 0, 4;
|
||||
cleararray .@count[0], 0, 4;
|
||||
setarray .@item[0], 717,715,716,714;
|
||||
setarray .@count[0], 300,300,300,300;
|
||||
.@ret = checkweight2(.@item,.@count);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure, total by weight
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure, total by weight
|
||||
|
||||
cleararray .@item[0], 0, 4;
|
||||
cleararray .@count[0], 0, 4;
|
||||
setarray .@item[0], 6320,6320;
|
||||
setarray .@count[0], 31000,2000;
|
||||
.@ret = checkweight2(.@item,.@count);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure, total by weight
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure, total by weight
|
||||
|
||||
cleararray .@item[0], 0, 2;
|
||||
cleararray .@count[0], 0, 2;
|
||||
setarray .@item[0], 2794,2795;
|
||||
setarray .@count[0], 95,5;
|
||||
.@ret = checkweight2(.@item,.@count);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
set .@success,.@success+ChkResult(.@testid++,1,.@ret); //should be success
|
||||
|
||||
setarray .@count[0], 95,10;
|
||||
.@ret = checkweight2(.@item,.@count);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure overamount item
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure overamount item
|
||||
|
||||
cleararray .@item[0], 0, 2;
|
||||
cleararray .@count[0], 0, 2;
|
||||
setarray .@item[0], 6320,6320,512;
|
||||
setarray .@count[0], 1,3;
|
||||
.@ret = checkweight2(.@item,.@count);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure, size mistmatch
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure, size mismatch
|
||||
|
||||
cleararray .@item[0], 0, 3;
|
||||
cleararray .@count[0], 0, 2;
|
||||
setarray .@item[0], 6320,6321;
|
||||
setarray .@count[0], 1,3,5;
|
||||
.@ret = checkweight2(.@item,.@count);
|
||||
set .@succes,.@succes+ChkResult(.@testid++,0,.@ret); //should be failure, size mistmatch
|
||||
set .@success,.@success+ChkResult(.@testid++,0,.@ret); //should be failure, size mismatch
|
||||
|
||||
set .@weight_limit, MaxWeight;
|
||||
set MaxWeight, 4294967296 - 1; //currently maxweight is stored as uint32 (2^32-1)
|
||||
set MaxWeight, 2147483647; //currently maxweight is stored as uint32 (2^32-1)
|
||||
cleararray .@item[0], 0, 2;
|
||||
cleararray .@count[0], 0, 3;
|
||||
setarray .@item[0], 714;
|
||||
setarray .@count[0], 300;
|
||||
.@ret = checkweight2(.@item,.@count);
|
||||
set MaxWeight, .@weight_limit;
|
||||
set .@succes,.@succes+ChkResult(.@testid++,1,.@ret); //should be success, (test weight over 65k)
|
||||
|
||||
set .@success,.@success+ChkResult(.@testid++,1,.@ret); //should be success, (test weight over 65k)
|
||||
|
||||
debugmes "End update by array tests";
|
||||
FinalReport(.@testid,.@succes);
|
||||
FinalReport(.@testid,.@success);
|
||||
|
||||
L_FINAL:
|
||||
end;
|
||||
|
||||
|
||||
function ChkResult {
|
||||
.@tid = getarg(0);
|
||||
.@expected = getarg(1);
|
||||
.@ret = getarg(2);
|
||||
.@sucess = (.@ret==.@expected);
|
||||
debugmes "Test "+.@tid+" = "+(.@sucess?"Sucess":"Fail");
|
||||
return .@sucess;
|
||||
.@success = (.@ret==.@expected);
|
||||
debugmes "Test "+.@tid+" = "+(.@success?"Success":"Fail");
|
||||
return .@success;
|
||||
}
|
||||
|
||||
function FinalReport {
|
||||
.@tdone = getarg(0);
|
||||
.@succes = getarg(1);
|
||||
debugmes "Results = Pass : "+.@succes+"/"+.@tdone+" Fails : "+(.@tdone-.@succes)+"/"+.@tdone;
|
||||
if(.@succes != .@tdone) { debugmes "Some failure as occured, enable chkresult print to found out"; }
|
||||
.@success = getarg(1);
|
||||
debugmes "Results = Pass : "+.@success+"/"+.@tdone+" Fails : "+(.@tdone-.@success)+"/"+.@tdone;
|
||||
if(.@success != .@tdone) { debugmes "Some failure has occurred. Enable chkresult print to find failed tests."; }
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user