Weird Posted January 10, 2012 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 11 Reputation: 0 Joined: 01/06/12 Last Seen: September 3, 2012 Share Posted January 10, 2012 Помогите придумать способ, как реализовать кастование скила без привязки к игроку или мобу. Например: NPC юзает дамажащий скил и наносит урон всем (игрокам и мобам). Пакеты clif_skill, clif_skilltopos не могут обойтись без id кастующего равно как и таймеры ground-юнитов" Quote Link to comment Share on other sites More sharing options...
Lilith Posted January 10, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 407 Reputation: 159 Joined: 11/18/11 Last Seen: November 15, 2014 Share Posted January 10, 2012 (edited) Тоже раньше нужно было. По поводу использования умения NPC'ом : Я использовал код от Kenpachi Index: src/map/script.c===================================================================--- src/map/script.c (revision 14801)+++ src/map/script.c (working copy)@@ -14853,6 +14853,56 @@}+// [Kenpachi]+// GetNPCInfo(type{, "NPCname"});+BUILDIN_FUNC(getnpcinfo)+{+ struct npc_data *nd;++ if(script_hasdata(st, 3))+ {+ nd = npc_name2id(script_getstr(st, 3));+ if(nd == NULL)+ {+ ShowError("getnpcgid: NPC not found: %sn", script_getstr(st, 3));+ script_pushint(st, -1);+ return 0;+ }+ }+ else+ nd = (struct npc_data *)map_id2bl(st->oid);++ switch(script_getnum(st, 2))+ {+ case 0: // map+ script_pushstrcopy(st, map[nd->bl.m].name);+ break;+ case 1: // x+ script_pushint(st, nd->bl.x);+ break;+ case 2: // y+ script_pushint(st, nd->bl.y);+ break;+ case 3: // view direction+ script_pushint(st, nd->ud.dir);+ break;+ case 4: // sprite id+ script_pushint(st, nd->class_);+ break;+ case 5: // GID+ script_pushint(st, nd->bl.id);+ break;+ case 6: // type+ script_pushint(st, nd->subtype);+ default:+ script_pushint(st, -1);+ break;+ }++ return 0;+}++// declarations that were supposed to be exported from npc_chat.c#ifdef PCRE_SUPPORTBUILDIN_FUNC(defpattern);@@ -15255,5 +15305,8 @@ BUILDIN_DEF(checkquest, "i?"), BUILDIN_DEF(changequest, "ii"), BUILDIN_DEF(showevent, "ii"),++ BUILDIN_DEF(getnpcinfo, "i?"), // [Kenpachi]+ {NULL,NULL,NULL},};[/codeBOX][b]Type[/b][color=#465584][font=Verdana, Tahoma, Arial,] - determines which value will be returned[/font][/color][b]NPCName[/b][color=#465584][font=Verdana, Tahoma, Arial,] - name of the npc which should be checked[/font][/color] [color=#465584][font=Verdana, Tahoma, Arial,]allowed types:[/font][/color] [color=#465584][font=Verdana, Tahoma, Arial,]0 - map name[/font][/color] [color=#465584][font=Verdana, Tahoma, Arial,]1 - x coordinate[/font][/color] [color=#465584][font=Verdana, Tahoma, Arial,]2 - y coordinate[/font][/color] [color=#465584][font=Verdana, Tahoma, Arial,]3 - view direction[/font][/color] [color=#465584][font=Verdana, Tahoma, Arial,]4 - sprite id[/font][/color] [b][color=#465584][font=Verdana, Tahoma, Arial,]5 - GID[/font][/color][/b] [color=#465584][font=Verdana, Tahoma, Arial,]6 - subtype (0 - warp | 1 - shop | 2 - script | 3 - cashshop)[/font][/color] [font=verdana,geneva,sans-serif]unitskilluseid getnpcinfo(5),489,5,getcharid(3); // CG_TAROTCARD,Tarot Card of Fate[/font][font=verdana,geneva,sans-serif]Вся проблема в том, что умения, наносящие урон, зависят от параметров ( атк, стр ну и пр. ), а у непися статов нет =[/font] Edited January 10, 2012 by Lilith Quote Link to comment Share on other sites More sharing options...
Weird Posted January 10, 2012 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 11 Reputation: 0 Joined: 01/06/12 Last Seen: September 3, 2012 Author Share Posted January 10, 2012 мм.. этот код - просто даёт получить идишник нпса.. Мне нужен не каст скилла самим нпсом, а чтобы скилл кастовался от статов, от гильдии, от пати игрока но пакет клиенту шел от пустого места ( банально - надо пройтись по карте метеорами чтобы игрок при этом не орал при каждом касте ) Quote Link to comment Share on other sites More sharing options...
Sanasol Posted January 10, 2012 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 185 Reputation: 53 Joined: 01/04/12 Last Seen: February 28 Share Posted January 10, 2012 ну так добавь пару переменных, чтобы кастовалось от имени нпц, но статы брались от иргока Quote Link to comment Share on other sites More sharing options...
Weird Posted January 11, 2012 Group: Members Topic Count: 6 Topics Per Day: 0.00 Content Count: 11 Reputation: 0 Joined: 01/06/12 Last Seen: September 3, 2012 Author Share Posted January 11, 2012 ... парой переменных дело не решить) разве что для 1 го скилла для какого-нибудь евента... просто всюду в скиллах стоят такие штуки что типа "если кастующий - игрок, считать такто; если моб - так то" и всюду добавлять - "если нпс" это жесть... так вот..нпс впринципе не може атаковать.. покапавшись понял что нпс не приводится к атакующему / цели через идишник.. нпс ( BL_NPC тип ) не приводится.. ок. вроде немного разобрался.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.