Changeset 23 for src/map/script.c

Show
Ignore:
Timestamp:
07/03/08 02:59:16 (17 years ago)
Author:
jinshiro
Message:

Temporarilly resolved problems with logging in. Changed familliar db to fix crash issue.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/map/script.c

    r1 r23  
    329329        MF_NOCHAT, 
    330330        MF_NOEXPPENALTY, 
    331         MF_GUILDLOCK, 
    332         MF_HOSTILE 
     331        MF_GUILDLOCK 
    333332}; 
     333 
    334334const char* script_op2name(int op) 
    335335{ 
     
    43244324                return 0; 
    43254325 
    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); 
    43284327        return 0; 
    43294328} 
     
    75717570        } 
    75727571                 
    7573         map_foreachinmap(buildin_killmonsterall_sub_strip, 
    7574                 m,BL_MOB); 
     7572        map_foreachinmap(buildin_killmonsterall_sub_strip,m,BL_MOB); 
    75757573        return 0; 
    75767574} 
     
    90299027                        case MF_PARTYLOCK:              script_pushint(st,map[m].flag.partylock); break; 
    90309028                        case MF_GUILDLOCK:              script_pushint(st,map[m].flag.guildlock); break; 
    9031                         case MF_HOSTILE:                script_pushint(st,map[m].flag.hostile); break;//Sketchy 
    90329029                } 
    90339030        } 
     
    90949091                        case MF_PARTYLOCK:     map[m].flag.partylock=1; break; 
    90959092                        case MF_GUILDLOCK:     map[m].flag.guildlock=1; break; 
    9096                         case MF_HOSTILE:                map[m].flag.hostile=1; break;//Sketchy 
    90979093                } 
    90989094        } 
     
    91569152                        case MF_PARTYLOCK:     map[m].flag.partylock=0; break; 
    91579153                        case MF_GUILDLOCK:     map[m].flag.guildlock=0; break; 
    9158                         case MF_HOSTILE:                map[m].flag.hostile=0; break;//Sketchy 
    91599154                } 
    91609155        } 
     
    1181011805        data = script_getdata(st,3); 
    1181111806 
     11807        if( script_hasdata(st,4) ) 
     11808                class_ = script_getnum(st,4); 
    1181211809        if( script_hasdata(st,5) ) 
    1181311810                size = script_getnum(st,5); 
    11814         if( script_hasdata(st,4) ) 
    11815                 class_ = script_getnum(st,4); 
    1181611811 
    1181711812        get_val(st, data); 
     
    1215012145                flag = script_getnum(st,3); 
    1215112146        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        { 
    1215312149                ShowError("buildin_callshop: Shop [%s] not found (or NPC is not shop type)\n", shopname); 
    1215412150                script_pushint(st,0); 
     
    1215612152        } 
    1215712153         
    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 
    1216912166        sd->npc_shopid = nd->bl.id; 
    1217012167        script_pushint(st,1); 
     
    1338113378} 
    1338213379 
    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 } 
    1342613380 
    1342713381// declarations that were supposed to be exported from npc_chat.c 
     
    1369713651        BUILDIN_DEF(getstrlen,"s"), //strlen [Valaris] 
    1369813652        BUILDIN_DEF(charisalpha,"si"), //isalpha [Valaris] 
    13699         BUILDIN_DEF(setnpcdisplay,"sv?"), 
     13653        BUILDIN_DEF(setnpcdisplay,"sv??"), 
    1370013654        BUILDIN_DEF(compare,"ss"), // Lordalfa - To bring strstr to scripting Engine. 
    1370113655        BUILDIN_DEF(getiteminfo,"ii"), //[Lupus] returns Items Buy / sell Price, etc info 
     
    1377413728        BUILDIN_DEF(setquestobjective, "iisi"), 
    1377513729        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] 
    1377913730        BUILDIN_DEF(hasquest, "i"), 
    1378013731        {NULL,NULL,NULL},