|
@@ -18171,6 +18171,56 @@ BUILDIN_FUNC(bonus_script) {
|
|
return SCRIPT_CMD_SUCCESS;
|
|
return SCRIPT_CMD_SUCCESS;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/** Adds amount of spirit ball to player
|
|
|
|
+* addspiritball <amount>{,<char_id>};
|
|
|
|
+*/
|
|
|
|
+BUILDIN_FUNC(addspiritball) {
|
|
|
|
+ uint8 amount = script_getnum(st,2);
|
|
|
|
+ struct map_session_data *sd;
|
|
|
|
+
|
|
|
|
+ if (script_getnum(st,3))
|
|
|
|
+ sd = map_charid2sd(script_getnum(st,3));
|
|
|
|
+ else
|
|
|
|
+ sd = script_rid2sd(st);
|
|
|
|
+ if (!sd)
|
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
|
+ pc_addspiritball(sd,max(amount,1),10);
|
|
|
|
+ return SCRIPT_CMD_SUCCESS;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/** Deletes amount of spirit ball from player
|
|
|
|
+* delspiritball <amount>{,<char_id>};
|
|
|
|
+*/
|
|
|
|
+BUILDIN_FUNC(delspiritball) {
|
|
|
|
+ uint8 amount = script_getnum(st,2);
|
|
|
|
+ struct map_session_data *sd;
|
|
|
|
+
|
|
|
|
+ if (script_getnum(st,3))
|
|
|
|
+ sd = map_charid2sd(script_getnum(st,3));
|
|
|
|
+ else
|
|
|
|
+ sd = script_rid2sd(st);
|
|
|
|
+ if (!sd)
|
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
|
+ pc_delspiritball(sd,max(amount,1),10);
|
|
|
|
+ return SCRIPT_CMD_SUCCESS;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+/** Counts amount of spirit ball that player has
|
|
|
|
+* delspiritball {,<char_id>};
|
|
|
|
+*/
|
|
|
|
+BUILDIN_FUNC(countspiritball) {
|
|
|
|
+ struct map_session_data *sd;
|
|
|
|
+
|
|
|
|
+ if (script_getnum(st,2))
|
|
|
|
+ sd = map_charid2sd(script_getnum(st,2));
|
|
|
|
+ else
|
|
|
|
+ sd = script_rid2sd(st);
|
|
|
|
+ if (!sd)
|
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
|
+ script_pushint(st,sd->spiritball);
|
|
|
|
+ return SCRIPT_CMD_SUCCESS;
|
|
|
|
+}
|
|
|
|
+
|
|
#include "../custom/script.inc"
|
|
#include "../custom/script.inc"
|
|
|
|
|
|
// declarations that were supposed to be exported from npc_chat.c
|
|
// declarations that were supposed to be exported from npc_chat.c
|
|
@@ -18654,6 +18704,9 @@ struct script_function buildin_func[] = {
|
|
BUILDIN_DEF(vip_time,"i?"),
|
|
BUILDIN_DEF(vip_time,"i?"),
|
|
#endif
|
|
#endif
|
|
BUILDIN_DEF(bonus_script,"si???"),
|
|
BUILDIN_DEF(bonus_script,"si???"),
|
|
|
|
+ BUILDIN_DEF(addspiritball,"??"),
|
|
|
|
+ BUILDIN_DEF(delspiritball,"??"),
|
|
|
|
+ BUILDIN_DEF(countspiritball,"?"),
|
|
|
|
|
|
#include "../custom/script_def.inc"
|
|
#include "../custom/script_def.inc"
|
|
|
|
|