Jump to content

Patskie

Members
  • Posts

    1702
  • Joined

  • Last visited

  • Days Won

    19

Everything posted by Patskie

  1. I have made a simple dynamic shop last time. You can use this and post if any error occur : - shop dynamicshop -1,501:20000 prontera,150,150,0 script Dynamic Shop 100,{ callshop "dynamicshop",1; npcshopattach "dynamicshop"; end; OnBuyItem: for ( set .@j, 0; .@j < getarraysize(.items); set .@j, .@j + 2 ) { for ( set .@k, 0; .@k < getarraysize(@bought_nameid); set .@k, .@k + 1 ) { if ( @bought_nameid[.@k] == .items[.@j] ) { if ( checkweight( @bought_nameid[.@k], @bought_quantity[.@k] ) ) { if ( countitem(.currency) < .items[.@j+1] || countitem(.currency) < ( .items[.@j+1] * @bought_quantity[.@k] ) ) dispbottom "You don't have enough " +getitemname(.currency)+ " to purchase this item."; else { delitem .currency, .items[.@j+1] * @bought_quantity[.@k]; getitem @bought_nameid[.@k], @bought_quantity[.@k]; } } else dispbottom "You cannot carry out more items with you"; } } } deletearray @bought_quantity, getarraysize(@bought_quantity); deletearray @bought_nameid, getarraysize(@bought_nameid); end; OnInit: set .currency, 7227; // TCG is used to buy items setarray .items, 4001,5,7227,100; // Usage : <item id>,<price> npcshopitem "dynamicshop",0,0; for ( set .@i, 0; .@i < getarraysize(.items); set .@i, .@i + 2 ) npcshopadditem "dynamicshop",.items[.@i],.items[.@i+1]; end; }
  2. This topic has been locked due to creation of duplicate topics. Besides, this has been created in wrong section
  3. Patch it and recompile your server. If it doesn't show any error while compiling then it might work. Otherwise ofcourse it has an error
  4. - script KillCashPoint -1,{ OnPCKillEvent: if (killedrid==getcharid(0)) end; //No Points, killed himself if (lastkilled==killedrid){ set lkcount,lkcount+1; if (lkcount>=5){ set #CASHPOINTS,#CASHPOINTS-3; dispbottom "You have Lose 3 points of Honour. Your Total Points are "+#CASHPOINTS; atcommand "@nuke "+strcharinfo(0); end; } else{ set #CASHPOINTS,#CASHPOINTS+1; dispbottom "You have gained 1 Point of Honour. Your Total Points are "+#CASHPOINTS; end; } } else{ set lastkilled,killedrid; set lkcount,1; set #CASHPOINTS,#CASHPOINTS+1; dispbottom "You have gained 1 Point of Honour. Your Total Points are "+#CASHPOINTS; end; } OnPCDieEvent: #CASHPOINTS--; dispbottom "Total cashpoints : " +#CASHPOINTS; end; }
  5. Test it and tell us whether it works or not.
  6. Alter the name of the character through SQL ( using query_sql command )
  7. There is no rAthena script command such as this : costume .@Part; // Convert the Headgear Apply this patch or download it via the attachment of the topic starter of this link ( http://rathena.org/board/topic/82370-costume-npc-and-costumeitem/ ) Index: atcommand.c =================================================================== --- atcommand.c (revision 17306) +++ atcommand.c (working copy) @@ -1117,7 +1117,7 @@ ACMD_FUNC(item) { char item_name[100]; - int number = 0, item_id, flag = 0; + int number = 0, item_id, flag = 0, costume = 0; struct item item_tmp; struct item_data *item_data; int get_count, i; @@ -1142,7 +1142,27 @@ clif_displaymessage(fd, msg_txt(sd,19)); // Invalid item ID or name. return -1; } - + + if( !strcmpi(command+1,"costumeitem") ) + { + if( !battle_config.reserved_costume_id ) + { + clif_displaymessage(fd, "Costume convertion is disable. Set a value for reserved_cosutme_id on your battle.conf file."); + return -1; + } + if( !(item_data->equip&EQP_HEAD_LOW) && + !(item_data->equip&EQP_HEAD_MID) && + !(item_data->equip&EQP_HEAD_TOP) && + !(item_data->equip&EQP_COSTUME_HEAD_LOW) && + !(item_data->equip&EQP_COSTUME_HEAD_MID) && + !(item_data->equip&EQP_COSTUME_HEAD_TOP) ) + { + clif_displaymessage(fd, "You cannot costume this item. Costume only work for headgears."); + return -1; + } + costume = 1; + } + item_id = item_data->nameid; get_count = number; //Check if it's stackable. @@ -1155,7 +1175,13 @@ memset(&item_tmp, 0, sizeof(item_tmp)); item_tmp.nameid = item_id; item_tmp.identify = 1; - + if( costume == 1 ) + { // Costume Item + item_tmp.card[0] = CARD0_CREATE; + item_tmp.card[2] = GetWord(battle_config.reserved_costume_id, 0); + item_tmp.card[3] = GetWord(battle_config.reserved_costume_id, 1); + } + if ((flag = pc_additem(sd, &item_tmp, get_count, LOG_TYPE_COMMAND))) clif_additem(sd, 0, 0, flag); } @@ -9251,7 +9277,9 @@ ACMD_DEF(channel), ACMD_DEF(fontcolor), ACMD_DEF(langtype), - ACMD_DEF(reloadmsgconf) + ACMD_DEF(reloadmsgconf), + ACMD_DEF2("costumeitem", item) + }; AtCommandInfo* atcommand; int i; Index: battle.c =================================================================== --- battle.c (revision 17306) +++ battle.c (working copy) @@ -5939,6 +5939,7 @@ { "item_enabled_npc", &battle_config.item_enabled_npc, 1, 0, 1, }, { "item_flooritem_check", &battle_config.item_onfloor, 1, 0, 1, }, { "bowling_bash_area", &battle_config.bowling_bash_area, 0, 0, 20, }, + { "reserved_costume_id", &battle_config.reserved_costume_id, 999998, 0, INT_MAX, }, }; #ifndef STATS_OPT_OUT /** Index: battle.h =================================================================== --- battle.h (revision 17306) +++ battle.h (working copy) @@ -488,6 +488,10 @@ int item_enabled_npc; int item_onfloor; // Whether to drop an undroppable item on the map or destroy it if inventory is full. int bowling_bash_area; + + // Costume System + int reserved_costume_id; + } battle_config; void do_init_battle(void); Index: map.c =================================================================== --- map.c (revision 17306) +++ map.c (working copy) @@ -1537,7 +1537,13 @@ struct map_session_data* tsd; nullpo_retv(sd); - + + if( battle_config.reserved_costume_id && battle_config.reserved_costume_id == charid ) + { + clif_solved_charname(sd->fd, charid, "Costume"); + return; + } + tsd = map_charid2sd(charid); if( tsd ) { Index: pc.c =================================================================== --- pc.c (revision 17306) +++ pc.c (working copy) @@ -66,8 +66,7 @@ struct fame_list chemist_fame_list[MAX_FAME_LIST]; struct fame_list taekwon_fame_list[MAX_FAME_LIST]; -static unsigned short equip_pos[EQI_MAX]={EQP_ACC_L,EQP_ACC_R,EQP_SHOES,EQP_GARMENT,EQP_HEAD_LOW,EQP_HEAD_MID,EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_COSTUME_HEAD_TOP,EQP_COSTUME_HEAD_MID,EQP_COSTUME_HEAD_LOW,EQP_COSTUME_GARMENT,EQP_AMMO}; - +static unsigned short equip_pos[EQI_MAX]={EQP_ACC_L,EQP_ACC_R,EQP_SHOES,EQP_GARMENT,EQP_HEAD_LOW,EQP_HEAD_MID,EQP_HEAD_TOP,EQP_ARMOR,EQP_HAND_L,EQP_HAND_R,EQP_AMMO,EQP_COSTUME_HEAD_TOP,EQP_COSTUME_HEAD_MID,EQP_COSTUME_HEAD_LOW,EQP_COSTUME_GARMENT}; #define MOTD_LINE_SIZE 128 static char motd_text[MOTD_LINE_SIZE][CHAT_SIZE_MAX]; // Message of the day buffer [Valaris] @@ -586,7 +585,7 @@ int pc_equippoint(struct map_session_data *sd,int n) { - int ep = 0; + int ep = 0, char_id = 0; nullpo_ret(sd); @@ -604,6 +603,15 @@ (sd->class_&MAPID_UPPERMASK) == MAPID_KAGEROUOBORO))//Kagerou and Oboro can dual wield daggers. [Rytech] return EQP_ARMS; } + + if( battle_config.reserved_costume_id && + sd->status.inventory[n].card[0] == CARD0_CREATE && + (char_id = MakeDWord(sd->status.inventory[n].card[2],sd->status.inventory[n].card[3])) == battle_config.reserved_costume_id ) + { // Costume Item - Converted + if( ep&EQP_HEAD_TOP ) { ep &= ~EQP_HEAD_TOP; ep |= EQP_COSTUME_HEAD_TOP; } + if( ep&EQP_HEAD_LOW ) { ep &= ~EQP_HEAD_LOW; ep |= EQP_COSTUME_HEAD_LOW; } + if( ep&EQP_HEAD_MID ) { ep &= ~EQP_HEAD_MID; ep |= EQP_COSTUME_HEAD_MID; } + } return ep; } @@ -1910,8 +1918,8 @@ if( autobonus[i].bonus_script ) { int j; - ARR_FIND( 0, EQI_MAX-1, j, sd->equip_index[j] >= 0 && sd->status.inventory[sd->equip_index[j]].equip == autobonus[i].pos ); - if( j < EQI_MAX-1 ) + ARR_FIND( 0, EQI_MAX_BONUS, j, sd->equip_index[j] >= 0 && sd->status.inventory[sd->equip_index[j]].equip == autobonus[i].pos ); + if( j < EQI_MAX_BONUS ) script_run_autobonus(autobonus[i].bonus_script,sd->bl.id,sd->equip_index[j]); } continue; @@ -1941,8 +1949,8 @@ if( autobonus->other_script ) { int j; - ARR_FIND( 0, EQI_MAX-1, j, sd->equip_index[j] >= 0 && sd->status.inventory[sd->equip_index[j]].equip == autobonus->pos ); - if( j < EQI_MAX-1 ) + ARR_FIND( 0, EQI_MAX_BONUS, j, sd->equip_index[j] >= 0 && sd->status.inventory[sd->equip_index[j]].equip == autobonus->pos ); + if( j < EQI_MAX_BONUS ) script_run_autobonus(autobonus->other_script,sd->bl.id,sd->equip_index[j]); } Index: pc.h =================================================================== --- pc.h (revision 17306) +++ pc.h (working copy) @@ -37,11 +37,12 @@ EQI_ARMOR, EQI_HAND_L, EQI_HAND_R, + EQI_AMMO, + EQI_MAX_BONUS = 10, EQI_COSTUME_TOP, EQI_COSTUME_MID, EQI_COSTUME_LOW, EQI_COSTUME_GARMENT, - EQI_AMMO, EQI_MAX }; Index: script.c =================================================================== --- script.c (revision 17306) +++ script.c (working copy) @@ -17596,6 +17596,52 @@ return 0; } +/*========================================== + * Costume Items + *------------------------------------------*/ +BUILDIN_FUNC(costume) +{ + int i = -1, num, ep; + TBL_PC *sd; + + num = script_getnum(st,2); // Equip Slot + sd = script_rid2sd(st); + + if( sd == NULL ) + return 0; + if( num > 0 && num <= ARRAYLENGTH(equip) ) + i = pc_checkequip(sd, equip[num - 1]); + if( i < 0 ) + return 0; + + ep = sd->status.inventory[i].equip; + if( !(ep&EQP_HEAD_LOW) && !(ep&EQP_HEAD_MID) && !(ep&EQP_HEAD_TOP) ) + return 0; + + log_pick_pc(sd, LOG_TYPE_SCRIPT, -1, &sd->status.inventory[i]); + pc_unequipitem(sd,i,2); + clif_delitem(sd,i,1,3); + // -------------------------------------------------------------------- + sd->status.inventory[i].refine = 0; + sd->status.inventory[i].attribute = 0; + sd->status.inventory[i].card[0] = CARD0_CREATE; + sd->status.inventory[i].card[1] = 0; + sd->status.inventory[i].card[2] = GetWord(battle_config.reserved_costume_id, 0); + sd->status.inventory[i].card[3] = GetWord(battle_config.reserved_costume_id, 1); + + if( ep&EQP_HEAD_TOP ) { ep &= ~EQP_HEAD_TOP; ep |= EQP_COSTUME_HEAD_TOP; } + if( ep&EQP_HEAD_LOW ) { ep &= ~EQP_HEAD_LOW; ep |= EQP_COSTUME_HEAD_LOW; } + if( ep&EQP_HEAD_MID ) { ep &= ~EQP_HEAD_MID; ep |= EQP_COSTUME_HEAD_MID; } + // -------------------------------------------------------------------- + log_pick_pc(sd, LOG_TYPE_SCRIPT, 1, &sd->status.inventory[i]); + + clif_additem(sd,i,1,0); + pc_equipitem(sd,i,ep); + clif_misceffect(&sd->bl,3); + + return 0; +} + // declarations that were supposed to be exported from npc_chat.c #ifdef PCRE_SUPPORT BUILDIN_FUNC(defpattern); @@ -18060,5 +18106,9 @@ BUILDIN_DEF(checkquest, "i?"), BUILDIN_DEF(changequest, "ii"), BUILDIN_DEF(showevent, "ii"), + + // Costume System + BUILDIN_DEF(costume,"i"), + {NULL,NULL,NULL}, }; Index: status.c =================================================================== --- status.c (revision 17306) +++ status.c (working copy) @@ -2455,7 +2455,7 @@ pc_delautobonus(sd,sd->autobonus3,ARRAYLENGTH(sd->autobonus3),true); // Parse equipment. - for(i=0;i<EQI_MAX-1;i++) { + for(i=0;i<EQI_MAX_BONUS;i++) { current_equip_item_index = index = sd->equip_index[i]; //We pass INDEX to current_equip_item_index - for EQUIP_SCRIPT (new cards solution) [Lupus] if(index < 0) continue; Index: battle.conf =================================================================== --- battle.conf (revision 17306) +++ battle.conf (working copy) @@ -141,3 +141,9 @@ // range. For example, Sonic Blow requires a 2 cell distance before autocasting is allowed. // This setting also affects autospellwhenhit. autospell_check_range: no + +// **************************************** +// Reserved Costume ID's +// **************************************** +// Reserved Char ID for costume converted items. +reserved_costume_id: 999998
  8. This : http://rathena.org/board/files/file/2504-multi-currency-shop/ Configuration : switch( getarg(0) ){ Case 1: // Currency [ Item ID / Variable Name ] set @Currency$,"7179"; // Item ID Lists setarray @ItemLists[0],6153,7227; // Item Price setarray @ItemCost[0],100,1; break; Case 2: // Currency [ Item ID / Variable Name ] set @Currency$,"7227"; // Item ID Lists setarray @ItemLists[0],2306,2302,2303,2304,2305,2301; // Item Price setarray @ItemCost[0],2,2,3,4,5,6; break; Case 3: // Currency [ Item ID / Variable Name ] set @Currency$,"#CASHPOINTS"; // Item ID Lists setarray @ItemLists[0],2306,2302,2303,2304,2305,2301; // Item Price setarray @ItemCost[0],20,22,34,445,52,641; break; // Case 4,5,6.....etc... default: ErrorNotice( "Invalid Menu Selection for Menu "+@menu+"." ); close; }
  9. Talk every 1 second with random message prontera,150,150,0 script Sample 123,{ end; Oninit: setarray .Messages$[0],"Random 1","Random 2"; while (1) { npctalk .Messages$[rand(getarraysize(.Messages$))]; sleep 1000; } end; }
  10. Refer : *resetlvl <action type>; This is a character reset command, meant mostly for rebirth script supporting Advanced jobs, which will reset the invoking character's stats and level depending on the action type given. Valid action types are: 1 - Base level 1, Job level 1, 0 skill points, 0 base exp, 0 job exp, wipes the status effects (only the ones settable by 'setoption'), sets all stats to 1. If the new job is 'Novice High', give 100 status points, give First Aid and Play Dead skills. 2 - Base level 1, Job level 1, 0 skill points, 0 base exp, 0 job exp. Skills and attribute values are not altered. 3 - Base level 1, base exp 0. Nothing else is changed. 4 - Job level 1, job exp 0. Nothing else is changed.
  11. When you use fakename i think some people can't invite you in a party or guild.
  12. I can't understand what does the regular chat referring? This? *message "<character name>","<message>"; That command will send a message to the chat window of the character specified by name. The text will also appear above the head of that character. It will not be seen by anyone else.
  13. - if (baselvl <150) goto R_Sorry; + if (BaseLevel < 150) goto R_Sorry; - atcommand "@blvl -200 "+strcharinfo(0); - atcommand "@jlvl -100 "+strcharinfo(0); - atcommand "@job 4001 "+strcharinfo(0); + BaseLevel -= 200; + JobLevel -= 100; + jobchange 4001; + means add - means remove
  14. Hanap ka hosting company. Pero need mo magbayad ng monthly basis
  15. This topic has been locked due to creation of multiple topics ( other topic link : http://rathena.org/board/topic/89665-pa-help-po-sa-npc-with-pub-pero-nacliclick-yung-npc/ )
  16. .Maps$ = menu selection .WarpMap$ = map name to be warped prontera,150,150,0 script Sample 100,{ setarray .Maps$[0],"Morocc","Prontera","Izlude"; setarray .WarpMap$[0],"payon","geffen","alberta"; .@menu$ = implode(.Maps$, ":"); mes "Where you want to battle?"; next; .@i = select(.@menu$) - 1; mes "Orayt bye bye ! ~"; warp .WarpMap$[.@i],0,0; close; }
  17. Patskie

    sql warning

    strcharinfo command have only this valid types : 0 - Character's name. 1 - The name of the party they're in if any. 2 - The name of the guild they're in if any. 3 - The name of the map the character is in. One of your scripts doesn't comply with the parameter value of strcharinfo command.
  18. Refer to doc/item_bonus.txt bonus bSpeedRate,n; Moving speed + n% (only the highest among all is applied) bonus bSpeedAddRate,n; Moving speed + n%
  19. Perhaps you can add your script here so it would be easy to help you out
×
×
  • Create New...