Changeset 23 for src/map/script.c
- Timestamp:
- 07/03/08 02:59:16 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
src/map/script.c
r1 r23 329 329 MF_NOCHAT, 330 330 MF_NOEXPPENALTY, 331 MF_GUILDLOCK, 332 MF_HOSTILE 331 MF_GUILDLOCK 333 332 }; 333 334 334 const char* script_op2name(int op) 335 335 { … … 4324 4324 return 0; 4325 4325 4326 map_foreachinarea(buildin_areawarp_sub, 4327 m,x0,y0,x1,y1,BL_PC, index,x,y ); 4326 map_foreachinarea(buildin_areawarp_sub, m,x0,y0,x1,y1,BL_PC, index,x,y); 4328 4327 return 0; 4329 4328 } … … 7571 7570 } 7572 7571 7573 map_foreachinmap(buildin_killmonsterall_sub_strip, 7574 m,BL_MOB); 7572 map_foreachinmap(buildin_killmonsterall_sub_strip,m,BL_MOB); 7575 7573 return 0; 7576 7574 } … … 9029 9027 case MF_PARTYLOCK: script_pushint(st,map[m].flag.partylock); break; 9030 9028 case MF_GUILDLOCK: script_pushint(st,map[m].flag.guildlock); break; 9031 case MF_HOSTILE: script_pushint(st,map[m].flag.hostile); break;//Sketchy9032 9029 } 9033 9030 } … … 9094 9091 case MF_PARTYLOCK: map[m].flag.partylock=1; break; 9095 9092 case MF_GUILDLOCK: map[m].flag.guildlock=1; break; 9096 case MF_HOSTILE: map[m].flag.hostile=1; break;//Sketchy9097 9093 } 9098 9094 } … … 9156 9152 case MF_PARTYLOCK: map[m].flag.partylock=0; break; 9157 9153 case MF_GUILDLOCK: map[m].flag.guildlock=0; break; 9158 case MF_HOSTILE: map[m].flag.hostile=0; break;//Sketchy9159 9154 } 9160 9155 } … … 11810 11805 data = script_getdata(st,3); 11811 11806 11807 if( script_hasdata(st,4) ) 11808 class_ = script_getnum(st,4); 11812 11809 if( script_hasdata(st,5) ) 11813 11810 size = script_getnum(st,5); 11814 if( script_hasdata(st,4) )11815 class_ = script_getnum(st,4);11816 11811 11817 11812 get_val(st, data); … … 12150 12145 flag = script_getnum(st,3); 12151 12146 nd = npc_name2id(shopname); 12152 if (!nd || nd->bl.type!=BL_NPC || nd->subtype!=SHOP) { 12147 if( !nd || nd->bl.type != BL_NPC || (nd->subtype != SHOP && nd->subtype != CASHSHOP) ) 12148 { 12153 12149 ShowError("buildin_callshop: Shop [%s] not found (or NPC is not shop type)\n", shopname); 12154 12150 script_pushint(st,0); … … 12156 12152 } 12157 12153 12158 switch (flag) { 12159 case 1: //Buy window 12160 npc_buysellsel(sd,nd->bl.id,0); 12161 break; 12162 case 2: //Sell window 12163 npc_buysellsel(sd,nd->bl.id,1); 12164 break; 12165 default: //Show menu 12166 clif_npcbuysell(sd,nd->bl.id); 12167 break; 12168 } 12154 if( nd->subtype == SHOP ) 12155 { 12156 switch( flag ) 12157 { 12158 case 1: npc_buysellsel(sd,nd->bl.id,0); break; //Buy window 12159 case 2: npc_buysellsel(sd,nd->bl.id,1); break; //Sell window 12160 default: clif_npcbuysell(sd,nd->bl.id); break; //Show menu 12161 } 12162 } 12163 else 12164 clif_cashshop_show(sd, nd); 12165 12169 12166 sd->npc_shopid = nd->bl.id; 12170 12167 script_pushint(st,1); … … 13381 13378 } 13382 13379 13383 /// Changes invoking character to alliance [sketchy]13384 /// usage: alliance;13385 BUILDIN_FUNC(god)13386 {13387 TBL_PC* sd;13388 sd = script_rid2sd(st);13389 if( sd == NULL )13390 return 0;13391 13392 sd->state.demon = 0;13393 sd->state.god = 1;13394 return 0;13395 }13396 13397 /// Changes invoking character to horde [sketchy]13398 /// usage: horde;13399 BUILDIN_FUNC(demon)13400 {13401 TBL_PC* sd;13402 13403 sd = script_rid2sd(st);13404 if( sd == NULL )13405 return 0;13406 13407 sd->state.god = 0;13408 sd->state.demon = 1;13409 return 0;13410 }13411 13412 /// Clears faction [sketchy]13413 /// usage: factionclear;13414 BUILDIN_FUNC(factionclear)13415 {13416 TBL_PC* sd;13417 13418 sd = script_rid2sd(st);13419 if( sd == NULL )13420 return 0;13421 13422 sd->state.god = 0;13423 sd->state.demon = 0;13424 return 0;13425 }13426 13380 13427 13381 // declarations that were supposed to be exported from npc_chat.c … … 13697 13651 BUILDIN_DEF(getstrlen,"s"), //strlen [Valaris] 13698 13652 BUILDIN_DEF(charisalpha,"si"), //isalpha [Valaris] 13699 BUILDIN_DEF(setnpcdisplay,"sv? "),13653 BUILDIN_DEF(setnpcdisplay,"sv??"), 13700 13654 BUILDIN_DEF(compare,"ss"), // Lordalfa - To bring strstr to scripting Engine. 13701 13655 BUILDIN_DEF(getiteminfo,"ii"), //[Lupus] returns Items Buy / sell Price, etc info … … 13774 13728 BUILDIN_DEF(setquestobjective, "iisi"), 13775 13729 BUILDIN_DEF(setqueststatus, "ii"), 13776 BUILDIN_DEF(god,""), // sets invoking character to alliance [Sketchy]13777 BUILDIN_DEF(demon,""), // sets invoking character to horde [Sketchy]13778 BUILDIN_DEF(factionclear,""), // clears invoking character's factions [Sketchy]13779 13730 BUILDIN_DEF(hasquest, "i"), 13780 13731 {NULL,NULL,NULL},