From 46311a784a46d1f1afb3173e73aff722f2208958 Mon Sep 17 00:00:00 2001 From: brianluau Date: Thu, 27 Aug 2009 05:14:42 +0000 Subject: - Fixed typo in Hyegun_Hat (5367). (bugreport:1935) - Added missing bonuses to Mask_Of_Ifrit (5420). (bugreport:2188) - Added better examples for some documentation. - Fixed item loss from mail if you are OVER 100% overweight. (bugreport:1862) - Fixed 'waitingroom2bg' checking wrong parameter. (bugreport:3330) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14034 54d463be-8e91-2dee-dedb-b68131a5f0ec --- db/item_db.txt | 4 ++-- doc/script_commands.txt | 54 +++++++++++++++++++++++++++++++++++++++---------- sql-files/item_db.sql | 4 ++-- src/map/clif.c | 2 +- src/map/script.c | 4 ++-- 5 files changed, 50 insertions(+), 18 deletions(-) diff --git a/db/item_db.txt b/db/item_db.txt index 616f94459..da1fb33ea 100644 --- a/db/item_db.txt +++ b/db/item_db.txt @@ -2504,7 +2504,7 @@ //5364,Dark_Snake_Lord_Hat,Evil Snake Lord Hat,5,20,,500,,2,,1,0xFFFFFFFF,7,2,256,,60,1,372,{ bonus bStr,1; bonus bInt,1; bonus bAgi,2; },{},{} //5365,Fried_Egg,Magnolia Hat,5,20,,1000,,3,,1,0xFFFFFFFF,7,2,256,,0,0,373,{ bonus2 bResEff,Eff_Stun,500; skill "HT_FLASHER",1; },{},{} //5366,Hat_0f_King,Love Dad Bandana,5,20,,200,,3,,0,0xFFFFFFFF,7,2,256,,0,1,374,{ bonus bStr,2; },{},{} -//5367,Hyegun_Hat,Hyegun Hat,5,20,,100,,5,,1,0xFFFFFFFF,7,2,769,,10,0,375,{ bonus bMdef,3; bonus2 bSubRace,RC_DemiHuman,10; },{},{} +//5367,Hyegun_Hat,Hyegun Hat,5,20,,100,,5,,1,0xFFFFFFFF,7,2,769,,10,0,375,{ bonus bMdef,3; bonus2 bSubRace,RC_Demon,10; },{},{} 5368,White_Wing,White Wing,5,20,,100,,2,,0,0xFFFFFFFE,7,2,256,,0,1,38,{ bonus2 bAddMonsterDropItem,12280,300; },{},{} 5369,Dark_Wing,Dark Wing,5,20,,100,,1,,0,0xFFFFFFFE,7,2,256,,0,1,39,{ bonus2 bAddMonsterDropItem,12279,300; },{},{} //5370,Orchid_Hairband,Orchid Hairband,5,20,,200,,1,,0,0xFFFFFFFF,7,2,256,,0,1,376,{ bonus bInt,1; },{},{} @@ -2557,7 +2557,7 @@ 5417,Crown_Parrot,Crown Parrots,5,20,,200,,1,,1,0xFFFFFFFF,7,2,256,,0,0,419,{ bonus2 bResEff,Eff_Silence,10000; bonus3 bAutoSpell,"DC_SCREAM",1,50; bonus bInt,1; },{},{} 5418,Soldier_Hat,Legionnaire Hat,5,20,,400,,4,,1,0xFFFFFFFF,7,2,256,,0,1,420,{ bonus bStr,1; bonus2 bAddRace,RC_NonBoss,3; bonus2 bAddRace,RC_Boss,3; },{},{} //5419,Evolved_Leaf,Leaves Of Grass,5,,,100,,0,,0,0xFFFFFFFF,7,2,1,,0,0,57,{ bonus bVit,1; bonus2 bSubRace,RC_Plant,5; },{},{} -//5420,Mask_Of_Ifrit,Mask Of Ifrit,5,,,0,,8,,0,0xFFFFFFFE,7,2,769,,70,0,421,{ bonus bStr,1; bonus bInt,1; bonus bMdef,5; bonus2 bSubEle,Ele_Fire,10; },{},{} +//5420,Mask_Of_Ifrit,Mask Of Ifrit,5,,,0,,8,,0,0xFFFFFFFE,7,2,769,,70,0,421,{ bonus bStr,1; bonus bInt,1; bonus bMdef,5; bonus2 bSubEle,Ele_Fire,10; bonus2 bSubEle,Ele_Water,-10; skill "MG_SIGHT",1; bonus3 bAutoSpellWhenHit,"WZ_METEOR",3,50; bonus3 bAutoSpell,"MG_FIREBOLT",3,50; },{},{ sc_end SC_SIGHT; } //5421,Ifrit's_Ear,Ears Of Ifrit,5,,,0,,0,,0,0xFFFFFFFE,7,2,512,,70,0,422,{ bonus bStr,1; bonus bMdef,3; bonus2 bSkillAtk,"MG_FIREBOLT",2; bonus2 bSkillAtk,"WZ_FIREPILLAR",2; bonus2 bSkillAtk,"WZ_METEOR",2; bonus2 bSkillAtk,"SM_BASH",2; bonus2 bSkillAtk,"SM_MAGNUM",2; bonus2 bSkillAtk,"KN_PIERCE",2; bonus2 bSubEle,Ele_Fire,5; },{},{} //5422,Linguistic_Book_Cap,Linguistic Book Hat,5,,,70,,0,,0,0xFFFFFFFF,7,2,256,,0,0,423,{ bonus bInt,1; bonus bMdef,2; },{},{} //5423,Lovecap_China,I Love China,5,,,250,,5,,0,0xFFFFFFFF,7,2,256,,0,0,424,{ bonus bDex,3; bonus2 bSubRace,RC_DemiHuman,10; },{},{} diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 7e7014673..1cca99f28 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -1480,16 +1480,48 @@ you like, to save space and time, without creating extra NPC objects which are needed with 'callfunc'. A label is not callable in this manner from another script. - mes "[Woman]" - mes "Lets see if you win"; - callsub Check; - mes "Well done you have won"; - close; - Check: - set @win, rand(2); - if(@win==0) return; - mes "Sorry you lost"; +Example 1: callsub for checking (if checks pass, return to script) + callsub S_CheckFull, "guild_vs2",50; + switch( rand(4) ) { + case 0: warp "guild_vs2",9,50; end; + case 1: warp "guild_vs2",49,90; end; + case 2: warp "guild_vs2",90,50; end; + case 3: warp "guild_vs2",49,9; end; + } + +... + +S_CheckFull: + if (getmapusers(getarg(0)) >= getarg(1)) { + mes "I'm sorry, this arena is full. Please try again later."; close; + } + return; + +Example 2: callsub used repeatedly, with different arguments +// notice how the zeny check/delete is reused, instead of copy-pasting for every warp + switch(select("Abyss Lake:Amatsu Dungeon:Anthell:Ayothaya Dungeon:Beacon Island, Pharos") { + case 1: callsub S_DunWarp,"hu_fild05",192,207; + case 2: callsub S_DunWarp,"ama_in02",119,181; + case 3: callsub S_DunWarp,"moc_fild20",164,145; + case 4: callsub S_DunWarp,"ayo_fild02",279,150; + case 5: callsub S_DunWarp,"cmd_fild07",132,125; + // etc + } + +... + +S_DunWarp: +// getarg(0) = "mapname" +// getarg(1) = x +// getarg(2) = y + if (Zeny >= 100) { + set Zeny, Zeny-100; + warp getarg(0),getarg(1),getarg(2); + } else { + mes "Dungeon warp costs 100 zeny."; + } + close; --------------------------------------- @@ -5624,8 +5656,8 @@ Example(s): //will set the base experience rate to 20x (2000%) setBattleFlag "base_exp_rate",2000; -//will return the value of the base experience rate (when used after the above example, it would return 2000). - getBattleFlag "base_exp_rate"; +//will return the value of the base experience rate (when used after the above example, it would print 2000). + mes getBattleFlag("base_exp_rate"); --------------------------------------- diff --git a/sql-files/item_db.sql b/sql-files/item_db.sql index 2fc451861..64ba3f72b 100644 --- a/sql-files/item_db.sql +++ b/sql-files/item_db.sql @@ -2535,7 +2535,7 @@ REPLACE INTO `item_db` VALUES (5362,'Ninja_Scroll','Ninja\'s Scroll',5,20,NULL,2 # REPLACE INTO `item_db` VALUES (5364,'Dark_Snake_Lord_Hat','Evil Snake Lord Hat',5,20,NULL,500,NULL,2,NULL,1,0xFFFFFFFF,7,2,256,NULL,60,1,372,'bonus bStr,1; bonus bInt,1; bonus bAgi,2;',NULL,NULL); # REPLACE INTO `item_db` VALUES (5365,'Fried_Egg','Magnolia Hat',5,20,NULL,1000,NULL,3,NULL,1,0xFFFFFFFF,7,2,256,NULL,0,0,373,'bonus2 bResEff,Eff_Stun,500; skill \"HT_FLASHER\",1;',NULL,NULL); # REPLACE INTO `item_db` VALUES (5366,'Hat_0f_King','Love Dad Bandana',5,20,NULL,200,NULL,3,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,374,'bonus bStr,2;',NULL,NULL); -# REPLACE INTO `item_db` VALUES (5367,'Hyegun_Hat','Hyegun Hat',5,20,NULL,100,NULL,5,NULL,1,0xFFFFFFFF,7,2,769,NULL,10,0,375,'bonus bMdef,3; bonus2 bSubRace,RC_DemiHuman,10;',NULL,NULL); +# REPLACE INTO `item_db` VALUES (5367,'Hyegun_Hat','Hyegun Hat',5,20,NULL,100,NULL,5,NULL,1,0xFFFFFFFF,7,2,769,NULL,10,0,375,'bonus bMdef,3; bonus2 bSubRace,RC_Demon,10;',NULL,NULL); REPLACE INTO `item_db` VALUES (5368,'White_Wing','White Wing',5,20,NULL,100,NULL,2,NULL,0,0xFFFFFFFE,7,2,256,NULL,0,1,38,'bonus2 bAddMonsterDropItem,12280,300;',NULL,NULL); REPLACE INTO `item_db` VALUES (5369,'Dark_Wing','Dark Wing',5,20,NULL,100,NULL,1,NULL,0,0xFFFFFFFE,7,2,256,NULL,0,1,39,'bonus2 bAddMonsterDropItem,12279,300;',NULL,NULL); # REPLACE INTO `item_db` VALUES (5370,'Orchid_Hairband','Orchid Hairband',5,20,NULL,200,NULL,1,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,1,376,'bonus bInt,1;',NULL,NULL); @@ -2588,7 +2588,7 @@ REPLACE INTO `item_db` VALUES (5410,'Bread_Bag2','Brown Paper Bag Hat',5,20,NULL REPLACE INTO `item_db` VALUES (5417,'Crown_Parrot','Crown Parrots',5,20,NULL,200,NULL,1,NULL,1,0xFFFFFFFF,7,2,256,NULL,0,0,419,'bonus2 bResEff,Eff_Silence,10000; bonus3 bAutoSpell,\"DC_SCREAM\",1,50; bonus bInt,1;',NULL,NULL); REPLACE INTO `item_db` VALUES (5418,'Soldier_Hat','Legionnaire Hat',5,20,NULL,400,NULL,4,NULL,1,0xFFFFFFFF,7,2,256,NULL,0,1,420,'bonus bStr,1; bonus2 bAddRace,RC_NonBoss,3; bonus2 bAddRace,RC_Boss,3;',NULL,NULL); # REPLACE INTO `item_db` VALUES (5419,'Evolved_Leaf','Leaves Of Grass',5,NULL,NULL,100,NULL,0,NULL,0,0xFFFFFFFF,7,2,1,NULL,0,0,57,'bonus bVit,1; bonus2 bSubRace,RC_Plant,5;',NULL,NULL); -# REPLACE INTO `item_db` VALUES (5420,'Mask_Of_Ifrit','Mask Of Ifrit',5,NULL,NULL,0,NULL,8,NULL,0,0xFFFFFFFE,7,2,769,NULL,70,0,421,'bonus bStr,1; bonus bInt,1; bonus bMdef,5; bonus2 bSubEle,Ele_Fire,10;',NULL,NULL); +# REPLACE INTO `item_db` VALUES (5420,'Mask_Of_Ifrit','Mask Of Ifrit',5,NULL,NULL,0,NULL,8,NULL,0,0xFFFFFFFE,7,2,769,NULL,70,0,421,'bonus bStr,1; bonus bInt,1; bonus bMdef,5; bonus2 bSubEle,Ele_Fire,10; bonus2 bSubEle,Ele_Water,-10; skill \"MG_SIGHT\",1; bonus3 bAutoSpellWhenHit,\"WZ_METEOR\",3,50; bonus3 bAutoSpell,\"MG_FIREBOLT\",3,50;',NULL,'sc_end SC_SIGHT;'); # REPLACE INTO `item_db` VALUES (5421,'Ifrit\'s_Ear','Ears Of Ifrit',5,NULL,NULL,0,NULL,0,NULL,0,0xFFFFFFFE,7,2,512,NULL,70,0,422,'bonus bStr,1; bonus bMdef,3; bonus2 bSkillAtk,\"MG_FIREBOLT\",2; bonus2 bSkillAtk,\"WZ_FIREPILLAR\",2; bonus2 bSkillAtk,\"WZ_METEOR\",2; bonus2 bSkillAtk,\"SM_BASH\",2; bonus2 bSkillAtk,\"SM_MAGNUM\",2; bonus2 bSkillAtk,\"KN_PIERCE\",2; bonus2 bSubEle,Ele_Fire,5;',NULL,NULL); # REPLACE INTO `item_db` VALUES (5422,'Linguistic_Book_Cap','Linguistic Book Hat',5,NULL,NULL,70,NULL,0,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,0,423,'bonus bInt,1; bonus bMdef,2;',NULL,NULL); # REPLACE INTO `item_db` VALUES (5423,'Lovecap_China','I Love China',5,NULL,NULL,250,NULL,5,NULL,0,0xFFFFFFFF,7,2,256,NULL,0,0,424,'bonus bDex,3; bonus2 bSubRace,RC_DemiHuman,10;',NULL,NULL); diff --git a/src/map/clif.c b/src/map/clif.c index 71df80b36..06a51354f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11959,7 +11959,7 @@ void clif_parse_Mail_getattach(int fd, struct map_session_data *sd) } weight = data->weight * sd->mail.inbox.msg[i].item.amount; - if( weight > sd->max_weight - sd->weight ) + if( sd->weight + weight > sd->max_weight ) { clif_Mail_getattachment(fd, 2); return; diff --git a/src/map/script.c b/src/map/script.c index 6597b3eae..f14d0179e 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -13476,8 +13476,8 @@ BUILDIN_FUNC(waitingroom2bg) int x, y, i, mapindex = 0, bg_id, n; struct map_session_data *sd; - if( script_hasdata(st,8) ) - nd = npc_name2id(script_getstr(st,8)); + if( script_hasdata(st,7) ) + nd = npc_name2id(script_getstr(st,7)); else nd = (struct npc_data *)map_id2bl(st->oid); -- cgit v1.2.3-70-g09d2