UID178554
帖子
精華
主題
積分16695
現金
積極性
威望
違規
熱心
推廣次數
閱讀權限30
註冊時間2009-7-26
在線時間 小時
最後登錄1970-1-1
TA的每日心情 | 慵懶 2013-7-11 12:09 AM |
---|
簽到天數: 118 天 連續簽到: 1 天 [LV.6]常住居民II
|
本帖最後由 Alopex 於 2011-6-30 05:08 PM 編輯
src\map\script.c
搜尋:
-
- BUILDIN_FUNC(monster)
- {
- const char* mapn = script_getstr(st,2);
- int x = script_getnum(st,3);
- int y = script_getnum(st,4);
- const char* str = script_getstr(st,5);
- int class_ = script_getnum(st,6);
- int amount = script_getnum(st,7);
- const char* event = "";
- struct map_session_data* sd;
- int m;
- if( script_hasdata(st,8) )
- {
- event = script_getstr(st,8);
- check_event(st, event);
- }
- if (class_ >= 0 && !mobdb_checkid(class_)) {
- ShowWarning("buildin_monster: Attempted to spawn non-existing monster class %d\n", class_);
- return 1;
- }
- sd = map_id2sd(st->rid);
- if( sd && strcmp(mapn,"this") == 0 )
- m = sd->bl.m;
- else
- {
- m = map_mapname2mapid(mapn);
- if( map[m].flag.src4instance && st->instance_id )
- { // Try to redirect to the instance map, not the src map
- if( (m = instance_mapid2imapid(m, st->instance_id)) < 0 )
- {
- ShowError("buildin_monster: Trying to spawn monster (%d) on instance map (%s) without instance attached.\n", class_, mapn);
- return 1;
- }
- }
- }
- mob_once_spawn(sd,m,x,y,str,class_,amount,event);
- return 0;
- }
複製代碼
改成
-
- BUILDIN_FUNC(monster)
- {int id;
- const char* mapn = script_getstr(st,2);
- int x = script_getnum(st,3);
- int y = script_getnum(st,4);
- const char* str = script_getstr(st,5);
- int class_ = script_getnum(st,6);
- int amount = script_getnum(st,7);
- const char* event = "";
- struct map_session_data* sd;
- int m;
- if( script_hasdata(st,8) )
- {
- event = script_getstr(st,8);
- check_event(st, event);
- }
- if (class_ >= 0 && !mobdb_checkid(class_)) {
- ShowWarning("buildin_monster: Attempted to spawn non-existing monster class %d\n", class_);
- return 1;
- }
- sd = map_id2sd(st->rid);
- if( sd && strcmp(mapn,"this") == 0 )
- m = sd->bl.m;
- else
- {
- m = map_mapname2mapid(mapn);
- if( map[m].flag.src4instance && st->instance_id )
- { // Try to redirect to the instance map, not the src map
- if( (m = instance_mapid2imapid(m, st->instance_id)) < 0 )
- {
- ShowError("buildin_monster: Trying to spawn monster (%d) on instance map (%s) without instance attached.\n", class_, mapn);
- return 1;
- }
- }
- }
- id = mob_once_spawn(sd,m,x,y,str,class_,amount,event);
- script_pushint(st,id);
- return 0;
- }
-
複製代碼
使用方法:set .GID,monster "<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>;
.GID就是魔物GID. |
評分
-
查看全部評分
|