|
@@ -9230,7 +9230,10 @@ BUILDIN_FUNC(addtimer)
|
|
|
if( sd == NULL )
|
|
|
return 0;
|
|
|
|
|
|
- pc_addeventtimer(sd,tick,event);
|
|
|
+ if (!pc_addeventtimer(sd,tick,event)) {
|
|
|
+ ShowWarning("buildin_addtimer: Event timer is full, can't add new event timer. (cid:%d timer:%s)\n",sd->status.char_id,event);
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
+ }
|
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
@@ -17679,7 +17682,9 @@ BUILDIN_FUNC(npcskill)
|
|
|
|
|
|
/* Consumes an item.
|
|
|
* consumeitem <item id>;
|
|
|
- * consumeitem "<item name>"; */
|
|
|
+ * consumeitem "<item name>";
|
|
|
+ * @param item: Item ID or name
|
|
|
+ */
|
|
|
BUILDIN_FUNC(consumeitem)
|
|
|
{
|
|
|
TBL_NPC *nd;
|
|
@@ -17698,30 +17703,30 @@ BUILDIN_FUNC(consumeitem)
|
|
|
|
|
|
if( ( item_data = itemdb_searchname( name ) ) == NULL ){
|
|
|
ShowError( "buildin_consumeitem: Nonexistant item %s requested.\n", name );
|
|
|
- return 1;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
}else if( data_isint( data ) ){
|
|
|
int nameid = conv_num( st, data );
|
|
|
|
|
|
if( ( item_data = itemdb_exists( nameid ) ) == NULL ){
|
|
|
ShowError("buildin_consumeitem: Nonexistant item %d requested.\n", nameid );
|
|
|
- return 1;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
}else{
|
|
|
ShowError("buildin_consumeitem: invalid data type for argument #1 (%d).", data->type );
|
|
|
- return 1;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
run_script( item_data->script, 0, sd->bl.id, nd->bl.id );
|
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-/*=======================================================
|
|
|
- * Make a player sit/stand.
|
|
|
+/** Makes a player sit/stand.
|
|
|
* sit {"<character name>"};
|
|
|
* stand {"<character name>"};
|
|
|
* Note: Use readparam(Sitting) which returns 1 or 0 (sitting or standing).
|
|
|
- *-------------------------------------------------------*/
|
|
|
+ * @param name: Player name that will be invoked
|
|
|
+ */
|
|
|
BUILDIN_FUNC(sit)
|
|
|
{
|
|
|
TBL_PC *sd;
|
|
@@ -17732,7 +17737,7 @@ BUILDIN_FUNC(sit)
|
|
|
sd = script_rid2sd(st);
|
|
|
|
|
|
if( sd == NULL)
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
|
|
|
if( !pc_issit(sd) ) {
|
|
|
unit_stop_walking(&sd->bl, 1|4);
|
|
@@ -17743,6 +17748,9 @@ BUILDIN_FUNC(sit)
|
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
+/** Makes player to stand
|
|
|
+* @param name: Player name that will be set
|
|
|
+*/
|
|
|
BUILDIN_FUNC(stand)
|
|
|
{
|
|
|
TBL_PC *sd;
|
|
@@ -17753,7 +17761,7 @@ BUILDIN_FUNC(stand)
|
|
|
sd = script_rid2sd(st);
|
|
|
|
|
|
if( sd == NULL)
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
|
|
|
if( pc_issit(sd) ) {
|
|
|
pc_setstand(sd);
|
|
@@ -17764,22 +17772,18 @@ BUILDIN_FUNC(stand)
|
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-/*==========================================
|
|
|
+/** Creates an array of bounded item IDs
|
|
|
* countbound {<type>};
|
|
|
- * Creates an array of bounded item IDs
|
|
|
- * Returns amount of items found
|
|
|
- * Type:
|
|
|
- * 1 - Account Bound
|
|
|
- * 2 - Guild Bound
|
|
|
- * 3 - Party Bound
|
|
|
- *------------------------------------------*/
|
|
|
+ * @param type: 1 - Account Bound; 2 - Guild Bound; 3 - Party Bound
|
|
|
+ * @return amt: Amount of items found
|
|
|
+ */
|
|
|
BUILDIN_FUNC(countbound)
|
|
|
{
|
|
|
int i, type, j=0, k=0;
|
|
|
TBL_PC *sd;
|
|
|
|
|
|
if( (sd = script_rid2sd(st)) == NULL )
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
|
|
|
type = script_hasdata(st,2)?script_getnum(st,2):0;
|
|
|
|
|
@@ -17798,17 +17802,19 @@ BUILDIN_FUNC(countbound)
|
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-/*==========================================
|
|
|
+/** Creates new party
|
|
|
* party_create "<party name>"{,<char id>{,<item share>{,<item share type>}}};
|
|
|
- * <item share>: 0-Each Take. 1-Party Share
|
|
|
- * <item share type>: 0-Each Take. 1-Even Share
|
|
|
- * Return values:
|
|
|
+ * @param party_name: String of party name that will be created
|
|
|
+ * @param char_id: Chara that will be leader of this new party. If no char_id specified, the invoker will be party leader
|
|
|
+ * @param item_share: 0-Each Take. 1-Party Share
|
|
|
+ * @param item_share_type: 0-Each Take. 1-Even Share
|
|
|
+ * @return val: Result value
|
|
|
* -3 - party name is exist
|
|
|
* -2 - player is in party already
|
|
|
* -1 - player is not found
|
|
|
* 0 - unknown error
|
|
|
* 1 - success, will return party id $@party_create_id
|
|
|
- *------------------------------------------*/
|
|
|
+ */
|
|
|
BUILDIN_FUNC(party_create)
|
|
|
{
|
|
|
char party_name[NAME_LENGTH];
|
|
@@ -17817,19 +17823,19 @@ BUILDIN_FUNC(party_create)
|
|
|
|
|
|
if( (!script_hasdata(st,3) && !(sd = script_rid2sd(st))) || (script_hasdata(st,3) && !(sd = map_charid2sd(script_getnum(st,3)))) ) {
|
|
|
script_pushint(st,-1);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
if( sd->status.party_id ) {
|
|
|
script_pushint(st,-2);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
safestrncpy(party_name,script_getstr(st,2),NAME_LENGTH);
|
|
|
trim(party_name);
|
|
|
if( party_searchname(party_name) ) {
|
|
|
script_pushint(st,-3);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
if( script_getnum(st,4) )
|
|
|
item1 = 1;
|
|
@@ -17841,17 +17847,18 @@ BUILDIN_FUNC(party_create)
|
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-/*==========================================
|
|
|
+/** Adds player to specified party
|
|
|
* party_addmember <party id>,<char id>;
|
|
|
- * Adds player to specified party
|
|
|
- * Return values:
|
|
|
+ * @param party_id: The party that will be entered by player
|
|
|
+ * @param char_id: Char id of player that will be joined to the party
|
|
|
+ * @return val: Result value
|
|
|
* -4 - party is full
|
|
|
* -3 - party is not found
|
|
|
* -2 - player is in party already
|
|
|
* -1 - player is not found
|
|
|
* 0 - unknown error
|
|
|
* 1 - success
|
|
|
- *------------------------------------------*/
|
|
|
+ */
|
|
|
BUILDIN_FUNC(party_addmember)
|
|
|
{
|
|
|
int party_id = script_getnum(st,2);
|
|
@@ -17860,46 +17867,46 @@ BUILDIN_FUNC(party_addmember)
|
|
|
|
|
|
if( !(sd = map_charid2sd(script_getnum(st,3))) ) {
|
|
|
script_pushint(st,-1);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
if( sd->status.party_id ) {
|
|
|
script_pushint(st,-2);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
if( !(party = party_search(party_id)) ) {
|
|
|
script_pushint(st,-3);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
if( party->party.count >= MAX_PARTY ) {
|
|
|
script_pushint(st,-4);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
sd->party_invite = party_id;
|
|
|
script_pushint(st,party_add_member(party_id,sd));
|
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-/*==========================================
|
|
|
+/** Removes player from his/her party. If party_id and char_id is empty remove the invoker from his/her party
|
|
|
* party_delmember {<char id>,<party_id>};
|
|
|
- * Removes player from his/her party. If party_id and char_id is empty
|
|
|
- * remove the invoker from his/her party
|
|
|
- * Return values:
|
|
|
+ * @param: char_id
|
|
|
+ * @param: party_id
|
|
|
+ * @return val: Result value
|
|
|
* -3 - player is not in party
|
|
|
* -2 - party is not found
|
|
|
* -1 - player is not found
|
|
|
* 0 - unknown error
|
|
|
* 1 - success
|
|
|
- *------------------------------------------*/
|
|
|
+ */
|
|
|
BUILDIN_FUNC(party_delmember)
|
|
|
{
|
|
|
TBL_PC *sd = NULL;
|
|
|
|
|
|
if( !script_hasdata(st,2) && !script_hasdata(st,3) && !(sd = script_rid2sd(st)) ) {
|
|
|
script_pushint(st,-1);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
if( sd || (script_getnum(st,2) && (sd = map_charid2sd(script_getnum(st,2)))) )
|
|
|
script_pushint(st,party_removemember2(sd,0,0));
|
|
@@ -17908,17 +17915,17 @@ BUILDIN_FUNC(party_delmember)
|
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-/*==========================================
|
|
|
+/** Changes party leader of specified party (even the leader is offline)
|
|
|
* party_changeleader <party id>,<char id>;
|
|
|
- * Can change party leader even the leader is not online
|
|
|
- * Return values:
|
|
|
+ * @param party_id: ID of party
|
|
|
+ * @param char_id: Char ID of new leader
|
|
|
+ * @return val: Result value
|
|
|
* -4 - player is party leader already
|
|
|
* -3 - player is not in this party
|
|
|
* -2 - player is not found
|
|
|
* -1 - party is not found
|
|
|
* 0 - unknown error
|
|
|
- * 1 - success
|
|
|
- *------------------------------------------*/
|
|
|
+ * 1 - success */
|
|
|
BUILDIN_FUNC(party_changeleader)
|
|
|
{
|
|
|
int i, party_id = script_getnum(st,2);
|
|
@@ -17928,59 +17935,55 @@ BUILDIN_FUNC(party_changeleader)
|
|
|
|
|
|
if( !(party = party_search(party_id)) ) {
|
|
|
script_pushint(st,-1);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
if( !(tsd = map_charid2sd(script_getnum(st,3))) ) {
|
|
|
script_pushint(st,-2);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
if( tsd->status.party_id != party_id ) {
|
|
|
script_pushint(st,-3);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
ARR_FIND(0,MAX_PARTY,i,party->party.member[i].leader);
|
|
|
if( i >= MAX_PARTY ) { //this is should impossible!
|
|
|
script_pushint(st,0);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
if( party->data[i].sd == tsd ) {
|
|
|
script_pushint(st,-4);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
script_pushint(st,party_changeleader(sd,tsd,party));
|
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-/*==========================================
|
|
|
+/** Changes party option
|
|
|
* party_changeoption <party id>,<option>,<flag>;
|
|
|
- * Return values:
|
|
|
- * -1 - party is not found
|
|
|
- * 0 - invalid option
|
|
|
- * 1 - success
|
|
|
- *------------------------------------------*/
|
|
|
+ * @param party_id: ID of party that will be changed
|
|
|
+ * @param option: Type of option
|
|
|
+ * @return val: -1 - party is not found, 0 - invalid option, 1 - success
|
|
|
+ */
|
|
|
BUILDIN_FUNC(party_changeoption)
|
|
|
{
|
|
|
struct party_data *party;
|
|
|
|
|
|
if( !(party = party_search(script_getnum(st,2))) ) {
|
|
|
script_pushint(st,-1);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
script_pushint(st,party_setoption(party,script_getnum(st,3),script_getnum(st,4)));
|
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-/*==========================================
|
|
|
+/** Destroys party with party id.
|
|
|
* party_destroy <party id>;
|
|
|
- * Destroys party with party id.
|
|
|
- * Return values:
|
|
|
- * 0 - failed
|
|
|
- * 1 - success
|
|
|
- *------------------------------------------*/
|
|
|
+ * @param party_id: ID of party that will be destroyed
|
|
|
+ */
|
|
|
BUILDIN_FUNC(party_destroy)
|
|
|
{
|
|
|
int i;
|
|
@@ -17988,7 +17991,7 @@ BUILDIN_FUNC(party_destroy)
|
|
|
|
|
|
if( !(party = party_search(script_getnum(st,2))) ) {
|
|
|
script_pushint(st,0);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
ARR_FIND(0,MAX_PARTY,i,party->party.member[i].leader);
|
|
@@ -18009,13 +18012,10 @@ BUILDIN_FUNC(party_destroy)
|
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-/*==========================================
|
|
|
-* Checks if a player's client version meets a required version or date.
|
|
|
-* @type :
|
|
|
-* 0 - check by version number
|
|
|
-* 1 - check by date
|
|
|
-* @return true/false
|
|
|
- *------------------------------------------*/
|
|
|
+/** Checks if a player's client version meets a required version or date.
|
|
|
+* @param type: 0 - check by version number; 1 - check by date
|
|
|
+* @param data: Input
|
|
|
+*/
|
|
|
BUILDIN_FUNC(is_clientver) {
|
|
|
TBL_PC *sd = NULL;
|
|
|
int type = script_getnum(st,2);
|
|
@@ -18028,7 +18028,7 @@ BUILDIN_FUNC(is_clientver) {
|
|
|
sd = script_rid2sd(st);
|
|
|
if (sd == NULL) {
|
|
|
script_pushint(st,0);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
switch(type){
|
|
@@ -18043,10 +18043,9 @@ BUILDIN_FUNC(is_clientver) {
|
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-/*==========================================
|
|
|
-* Retrieves server definitions.
|
|
|
-* (see @type in const.txt)
|
|
|
- *------------------------------------------*/
|
|
|
+/** Retrieves server definitions
|
|
|
+* @param type: See in const.txt
|
|
|
+*/
|
|
|
BUILDIN_FUNC(getserverdef) {
|
|
|
int type = script_getnum(st,2);
|
|
|
switch(type){
|
|
@@ -18070,9 +18069,10 @@ BUILDIN_FUNC(getserverdef) {
|
|
|
return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
-/* Returns various information about a player's VIP status.
|
|
|
+/** Returns various information about a player's VIP status. Need to enable VIP system
|
|
|
* vip_status <type>,{"<character name>"};
|
|
|
- * Note: VIP System needs to be enabled.
|
|
|
+ * @param type: Info type, 1: VIP status, 2: Expired date, 3: Remaining time
|
|
|
+ * @param name: Character name (Optional)
|
|
|
*/
|
|
|
BUILDIN_FUNC(vip_status) {
|
|
|
#ifdef VIP_ENABLE
|
|
@@ -18087,7 +18087,7 @@ BUILDIN_FUNC(vip_status) {
|
|
|
sd = script_rid2sd(st);
|
|
|
|
|
|
if (sd == NULL)
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
|
|
|
switch(type) {
|
|
|
case 1: // Get VIP status.
|
|
@@ -18120,10 +18120,10 @@ BUILDIN_FUNC(vip_status) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-/* Adds or removes VIP time in minutes.
|
|
|
+/** Adds or removes VIP time in minutes. Need to enable VIP system
|
|
|
* vip_time <time in mn>,{"<character name>"};
|
|
|
- * If time < 0 remove time, else add time.
|
|
|
- * Note: VIP System needs to be enabled.
|
|
|
+ * @param time: VIP duration in minutes. If time < 0 remove time, else add time.
|
|
|
+ * @param name: Character name (optional)
|
|
|
*/
|
|
|
BUILDIN_FUNC(vip_time) {
|
|
|
#ifdef VIP_ENABLE //would be a pain for scripting npc otherwise
|
|
@@ -18136,7 +18136,7 @@ BUILDIN_FUNC(vip_time) {
|
|
|
sd = script_rid2sd(st);
|
|
|
|
|
|
if (sd == NULL)
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
|
|
|
chrif_req_login_operation(sd->status.account_id, sd->status.name, 6, viptime, 7, 0);
|
|
|
#endif
|
|
@@ -18144,10 +18144,16 @@ BUILDIN_FUNC(vip_time) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-/*==========================================
|
|
|
- * Turns a player into a monster and grants SC attribute effect. [malufett/Hercules]
|
|
|
+/** Turns a player into a monster and grants SC attribute effect. [malufett/Hercules]
|
|
|
* montransform <monster name/ID>, <duration>, <sc type>, <val1>, <val2>, <val3>, <val4>;
|
|
|
- *------------------------------------------*/
|
|
|
+ * @param monster: Monster ID or name
|
|
|
+ * @param duration: Transform duration in millisecond (ms)
|
|
|
+ * @param sc_type: Type of SC that will be affected during the transformation
|
|
|
+ * @param val1: Value for SC
|
|
|
+ * @param val2: Value for SC
|
|
|
+ * @param val3: Value for SC
|
|
|
+ * @param val4: Value for SC
|
|
|
+ */
|
|
|
BUILDIN_FUNC(montransform) {
|
|
|
|
|
|
TBL_PC *sd;
|
|
@@ -18175,17 +18181,17 @@ BUILDIN_FUNC(montransform) {
|
|
|
ShowWarning("buildin_montransform: Attempted to use non-existing monster '%s'.\n", script_getstr(st, 2));
|
|
|
else
|
|
|
ShowWarning("buildin_montransform: Attempted to use non-existing monster of ID '%d'.\n", script_getnum(st, 2));
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
if (mob_id == MOBID_EMPERIUM) {
|
|
|
ShowWarning("buildin_montransform: Monster 'Emperium' cannot be used.\n");
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
if (!(type > SC_NONE && type < SC_MAX)) {
|
|
|
ShowWarning("buildin_montransform: Unsupported status change id %d\n", type);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
if (script_hasdata(st, 5))
|
|
@@ -18205,12 +18211,12 @@ BUILDIN_FUNC(montransform) {
|
|
|
|
|
|
if (battle_config.mon_trans_disable_in_gvg && map_flag_gvg2(sd->bl.m)) {
|
|
|
clif_displaymessage(sd->fd, msg_txt(sd,1500)); // Transforming into monster is not allowed in Guild Wars.
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
if (sd->disguise){
|
|
|
clif_displaymessage(sd->fd, msg_txt(sd,1498)); // Cannot transform into monster while in disguise.
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
sprintf(msg, msg_txt(sd,1497), monster->name); // Traaaansformation-!! %s form!!
|
|
@@ -18246,7 +18252,7 @@ BUILDIN_FUNC(bonus_script) {
|
|
|
sd = script_rid2sd(st);
|
|
|
|
|
|
if (sd == NULL)
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
|
|
|
script_str = script_getstr(st,2);
|
|
|
dur = 1000 * abs(script_getnum(st,3));
|
|
@@ -18255,27 +18261,27 @@ BUILDIN_FUNC(bonus_script) {
|
|
|
FETCH(6,icon);
|
|
|
|
|
|
if (script_str[0] == '\0' || !dur) {
|
|
|
- //ShowWarning("buildin_bonus_script: Invalid value(s). Skipping...\n");
|
|
|
- return 0;
|
|
|
+ //ShowWarning("buildin_bonus_script: Invalid script. Skipping...\n");
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
//Skip duplicate entry
|
|
|
ARR_FIND(0,MAX_PC_BONUS_SCRIPT,i,&sd->bonus_script[i] && sd->bonus_script[i].script_str && strcmp(sd->bonus_script[i].script_str,script_str) == 0);
|
|
|
if (i < MAX_PC_BONUS_SCRIPT) {
|
|
|
//ShowWarning("buildin_bonus_script: Duplicate entry with bonus '%d'. Skipping...\n",i);
|
|
|
- return 0;
|
|
|
+ return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
if (!(script = parse_script(script_str,"bonus_script",0,1))) {
|
|
|
- //ShowWarning("buildin_bonus_script: Failed to parse script '%s'. Skipping...\n",script_str);
|
|
|
- return 0;
|
|
|
+ ShowWarning("buildin_bonus_script: Failed to parse script '%s' (cid:%d). Skipping...\n",script_str,sd->status.char_id);
|
|
|
+ return SCRIPT_CMD_FAILURE;
|
|
|
}
|
|
|
|
|
|
//Find the empty slot
|
|
|
ARR_FIND(0,MAX_PC_BONUS_SCRIPT,i,!sd->bonus_script[i].script);
|
|
|
if (i >= MAX_PC_BONUS_SCRIPT) {
|
|
|
- ShowWarning("buildin_itemscript: Maximum script_bonus is reached (max: %d). Skipping...\n",MAX_PC_BONUS_SCRIPT);
|
|
|
- return 0;
|
|
|
+ ShowWarning("buildin_itemscript: Maximum script_bonus is reached (cid:%d max: %d). Skipping...\n",sd->status.char_id,MAX_PC_BONUS_SCRIPT);
|
|
|
+ return SCRIPT_CMD_SUCCESS;
|
|
|
}
|
|
|
|
|
|
//Add the script data
|