Changeset 23 for src/map

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.

Location:
src/map
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • src/map/npc.c

    r1 r23  
    783783int npc_touch_areanpc2(struct mob_data *md) 
    784784{ 
    785         int i, m = md->bl.m, x = md->bl.x, y = md->bl.y; 
     785        int i, m = md->bl.m, x = md->bl.x, y = md->bl.y, id; 
    786786        char eventname[NAME_LENGTH*2+3]; 
    787787        struct event_data* ev; 
     
    827827                                                break; // No OnTouchNPC Event 
    828828                                        md->areanpc_id = map[m].npc[i]->bl.id; 
     829                                        id = md->bl.id; // Stores Unique ID 
    829830                                        run_script(ev->nd->u.scr.script, ev->pos, md->bl.id, ev->nd->bl.id); 
     831                                        if( map_id2md(id) == NULL ) return 1; // Not Warped, but killed 
    830832                                        break; 
    831833                        } 
     
    20622064        switch(nd->subtype) 
    20632065        { 
    2064                 case WARP: 
    2065                         xs = nd->u.warp.xs; 
    2066                         ys = nd->u.warp.ys; 
    2067                         break; 
    2068                 case SCRIPT: 
    2069                         xs = nd->u.scr.xs; 
    2070                         ys = nd->u.scr.ys; 
    2071                         break; 
    2072                 default: 
    2073                         return; // Other types doesn't have touch area 
     2066        case WARP: 
     2067                xs = nd->u.warp.xs; 
     2068                ys = nd->u.warp.ys; 
     2069                break; 
     2070        case SCRIPT: 
     2071                xs = nd->u.scr.xs; 
     2072                ys = nd->u.scr.ys; 
     2073                break; 
     2074        default: 
     2075                return; // Other types doesn't have touch area 
    20742076        } 
    20752077 
     
    26252627        else if (!strcmpi(w3,"guildlock")) 
    26262628                map[m].flag.guildlock=state; 
    2627         else if (!strcmpi(w3,"hostile")) 
    2628         map[m].flag.hostile=state;//Sketchy 
    26292629        else 
    26302630                ShowError("npc_parse_mapflag: unrecognized mapflag '%s' (file '%s', line '%d').\n", w3, filepath, strline(buffer,start-buffer)); 
     
    29002900                "\t-'"CL_WHITE"%d"CL_RESET"' Shops\n" 
    29012901                "\t-'"CL_WHITE"%d"CL_RESET"' Scripts\n" 
    2902                 "\t-'"CL_WHITE"%d"CL_RESET"' Mob sets\n" 
     2902                "\t-'"CL_WHITE"%d"CL_RESET"' Spawn sets\n" 
    29032903                "\t-'"CL_WHITE"%d"CL_RESET"' Mobs Cached\n" 
    29042904                "\t-'"CL_WHITE"%d"CL_RESET"' Mobs Not Cached\n", 
     
    30113011                "\t-'"CL_WHITE"%d"CL_RESET"' Shops\n" 
    30123012                "\t-'"CL_WHITE"%d"CL_RESET"' Scripts\n" 
    3013                 "\t-'"CL_WHITE"%d"CL_RESET"' Mob sets\n" 
     3013                "\t-'"CL_WHITE"%d"CL_RESET"' Spawn sets\n" 
    30143014                "\t-'"CL_WHITE"%d"CL_RESET"' Mobs Cached\n" 
    30153015                "\t-'"CL_WHITE"%d"CL_RESET"' Mobs Not Cached\n", 
  • 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}, 
  • src/map/skill.c

    r22 r23  
    4242#define GD_SKILLRANGEMIN 900 
    4343#define GD_SKILLRANGEMAX GD_SKILLRANGEMIN+MAX_GUILDSKILL 
    44 #define HM_SKILLRANGEMIN 1100 
     44#define HM_SKILLRANGEMIN 1000 
    4545#define HM_SKILLRANGEMAX HM_SKILLRANGEMIN+MAX_HOMUNSKILL 
    4646