04-22-2018, 10:38 AM
Добрый день. Такая вот интересная ситуация при написании НПЦ баффера на PTS. Сервер Gracia Final 83 , без длл рпг-клаба.
Был создан нпц(скопирован нпц Newbie Guide), создан AI npc_buffer (к примеру), и в итоге нпц выдает баффы с помощью функции CastBuffForQuestReward, опять же взятой с AI НПЦ Newbie Guide.
Баффы выдает как надо, даже видно что нпц кастует скилл, НО нет ни эффекта наложения баффа на чара, ни звука от баффа, но самое интересное, что у нпц Newbie Guide при баффе новичка, есть и эффект наложения баффа и звук. Пробовал использовать функцию - AddUseSkillDesire, эффект наложения есть, но звука скилла опять же нет, да и время баффа большое, так что от этой функции отказался.
Вопрос - как все таки сделать, чтобы присутствовали визуальные и звуковые эффекты баффа? У Newbie Guide же есть
Был создан нпц(скопирован нпц Newbie Guide), создан AI npc_buffer (к примеру), и в итоге нпц выдает баффы с помощью функции CastBuffForQuestReward, опять же взятой с AI НПЦ Newbie Guide.
Баффы выдает как надо, даже видно что нпц кастует скилл, НО нет ни эффекта наложения баффа на чара, ни звука от баффа, но самое интересное, что у нпц Newbie Guide при баффе новичка, есть и эффект наложения баффа и звук. Пробовал использовать функцию - AddUseSkillDesire, эффект наложения есть, но звука скилла опять же нет, да и время баффа большое, так что от этой функции отказался.
Вопрос - как все таки сделать, чтобы присутствовали визуальные и звуковые эффекты баффа? У Newbie Guide же есть
AI баффера
Код:
class npc_buffer : citizen {
parameter:
string start = "npc_buffer_main.htm";
handler:
EventHandler TALKED(talker)
{
ShowPage(talker, start);
return;
}
EventHandler MENU_SELECTED(ask, reply, talker)
{
if( ask == 1000 && reply == 1 )
{
CastBuffForQuestReward(talker, 2064449539);
CastBuffForQuestReward(talker, 2064777218);
CastBuffForQuestReward(talker, 2065170436);
CastBuffForQuestReward(talker, 2064580610);
CastBuffForQuestReward(talker, 2066284547);
CastBuffForQuestReward(talker, 2064711683);
CastBuffForQuestReward(talker, 2064842755);
CastBuffForQuestReward(talker, 2064908291);
}
if( ask == 1000 && reply == 2 )
{
CastBuffForQuestReward(talker, 2064384003);
CastBuffForQuestReward(talker, 2064449539);
CastBuffForQuestReward(talker, 2064515075);
CastBuffForQuestReward(talker, 2064580610);
CastBuffForQuestReward(talker, 2065367042);
CastBuffForQuestReward(talker, 2064646147);
CastBuffForQuestReward(talker, 2065170436);
CastBuffForQuestReward(talker, 2064711683);
}
}
}
AI Newbie Guide
Код:
class newbie_guide extends citizen
{
parameters:
string fnHi = "";
string fnHighLevel = "";
string fnRaceMisMatch = "";
string fnGuideF05 = "";
string fnGuideF10 = "";
string fnGuideF15 = "";
string fnGuideF20 = "";
string fnGuideM07 = "";
string fnGuideM14 = "";
string fnGuideM20 = "";
string ShopName = "";
string fnCoupon1Ok = "newbie_guide002.htm";
string fnCoupon1Not1 = "newbie_guide003.htm";
string fnCoupon1Not2 = "newbie_guide004.htm";
string fnCoupon1Not3 = "newbie_guide005.htm";
string fnCoupon2Ok = "newbie_guide011.htm";
string fnCoupon2Not1 = "newbie_guide012.htm";
string fnCoupon2Not2 = "newbie_guide013.htm";
string fnCoupon2Not3 = "newbie_guide014.htm";
int num_coupon1 = 5;
int num_coupon2 = 1;
string fnNoSummonCreature = "blessing_list002b.htm";
property:
teleportList Position:
{"Talking Island Village"; -84169; 244693; -3729; 100000; 0 }
EventHandler TALKED(talker)
{
myself->ShowPage(talker, fnHi);
}
EventHandler CREATED()
{
myself->RegisterTeleporterType(1, 0);
super;
}
EventHandler MENU_SELECTED(talker, ask, reply, i0, c0)
{
if (ask == -7 && reply == 1)
{
if (myself->sm->race == 5)
{
if (talker->race != myself->sm->race)
{
myself->ShowPage(talker, "guide_krenisk003.htm");
}
else if (talker->level > 20 || myself->IsInCategory(62, talker->occupation) != 1)
{
myself->ShowPage(talker, "guide_krenisk002.htm");
}
else if (talker->occupation == 123)
{
if (talker->level <= 5)
{
myself->ShowPage(talker, "guide_krenisk_kmf05.htm");
}
else if (talker->level <= 10)
{
myself->ShowPage(talker, "guide_krenisk_kmf10.htm");
}
else if (talker->level <= 15)
{
myself->ShowPage(talker, "guide_krenisk_kmf15.htm");
}
else
{
myself->ShowPage(talker, "guide_krenisk_kmf20.htm");
}
}
else if (talker->occupation == 124)
{
if (talker->level <= 5)
{
myself->ShowPage(talker, "guide_krenisk_kff05.htm");
}
else if (talker->level <= 10)
{
myself->ShowPage(talker, "guide_krenisk_kff10.htm");
}
else if (talker->level <= 15)
{
myself->ShowPage(talker, "guide_krenisk_kff15.htm");
}
else
{
myself->ShowPage(talker, "guide_krenisk_kff20.htm");
}
}
}
else if (talker->race != myself->sm->race)
{
myself->ShowPage(talker, fnRaceMisMatch);
}
else if (talker->level > 20 || myself->IsInCategory(6, talker->occupation) == 0)
{
myself->ShowPage(talker, fnHighLevel);
}
else if (myself->IsInCategory(0, talker->occupation))
{
if (talker->level <= 5)
{
myself->ShowPage(talker, fnGuideF05);
}
else if (talker->level <= 10)
{
myself->ShowPage(talker, fnGuideF10);
}
else if (talker->level <= 15)
{
myself->ShowPage(talker, fnGuideF15);
}
else
{
myself->ShowPage(talker, fnGuideF20);
}
}
else if (talker->level <= 7)
{
myself->ShowPage(talker, fnGuideM07);
}
else if (talker->level <= 14)
{
myself->ShowPage(talker, fnGuideM14);
}
else
{
myself->ShowPage(talker, fnGuideM20);
}
}
else if (ask == -7 && reply == 2)
{
if (talker->level <= 75)
{
if (talker->level < 6)
{
myself->ShowPage(talker, "guide_for_newbie002.htm");
}
else if (myself->IsInCategory(66, talker->occupation))
{
myself->CastBuffForQuestReward(talker, 283246593);
myself->CastBuffForQuestReward(talker, 283312129);
myself->CastBuffForQuestReward(talker, 369426433);
myself->CastBuffForQuestReward(talker, 283377665);
myself->CastBuffForQuestReward(talker, 283443201);
myself->CastBuffForQuestReward(talker, 283508737);
if (talker->level >= 6 && talker->level <= 39)
{
myself->CastBuffForQuestReward(talker, 283574273);
}
if (talker->level >= 40 && talker->level <= 75)
{
myself->CastBuffForQuestReward(talker, 369098753);
}
if (talker->level >= 16 && talker->level <= 34)
{
myself->CastBuffForQuestReward(talker, 284295169);
}
}
else if (myself->IsInCategory(67, talker->occupation))
{
myself->CastBuffForQuestReward(talker, 283246593);
myself->CastBuffForQuestReward(talker, 283312129);
myself->CastBuffForQuestReward(talker, 369426433);
myself->CastBuffForQuestReward(talker, 283639809);
myself->CastBuffForQuestReward(talker, 283705345);
myself->CastBuffForQuestReward(talker, 283770881);
myself->CastBuffForQuestReward(talker, 283836417);
if (talker->level >= 16 && talker->level <= 34)
{
myself->CastBuffForQuestReward(talker, 284295169);
}
}
}
else
{
myself->ShowPage(talker, "guide_for_newbie003.htm");
}
}
else if (ask == -7 && reply == 3)
{
if (talker->level <= 39 && (myself->IsInCategory(6, talker->occupation) || myself->IsInCategory(7, talker->occupation)))
{
myself->CastBuffForQuestReward(talker, 339607553);
}
else
{
myself->ShowPage(talker, "pk_protect002.htm");
}
}
else if (ask == -7 && reply == 4)
{
c0 = myself->GetSummon(talker);
if (myself->IsNullCreature(c0) == 0 && myself->IsInCategory(12, c0->class_id) && myself->IsInCategory(35, c0->class_id) == 0)
{
if (talker->level < 6 || talker->level > 75)
{
myself->ShowPage(talker, "guide_for_newbie003.htm");
}
else
{
myself->CastBuffForQuestReward(c0, 283246593);
myself->CastBuffForQuestReward(c0, 283312129);
myself->CastBuffForQuestReward(c0, 369426433);
myself->CastBuffForQuestReward(c0, 283377665);
myself->CastBuffForQuestReward(c0, 283443201);
myself->CastBuffForQuestReward(c0, 283508737);
myself->CastBuffForQuestReward(c0, 283639809);
myself->CastBuffForQuestReward(c0, 283705345);
myself->CastBuffForQuestReward(c0, 283770881);
myself->CastBuffForQuestReward(c0, 283836417);
if (talker->level >= 6 && talker->level <= 39)
{
myself->CastBuffForQuestReward(c0, 283574273);
}
if (talker->level >= 40 && talker->level <= 75)
{
myself->CastBuffForQuestReward(c0, 369098753);
}
}
}
else
{
myself->ShowPage(talker, fnNoSummonCreature);
}
}
if (ask == -1000)
{
switch (reply)
{
case 1:
{
if (talker->level > 5)
{
if (talker->level < 20 && myself->IsInCategory(6, talker->occupation))
{
if (myself->GetOneTimeQuestFlag(talker, 207) == 0)
{
if (myself->GetInventoryInfo(talker, 0) >= (myself->GetInventoryInfo(talker, 1) * 0.800000) || myself->GetInventoryInfo(talker, 2) >= (myself->GetInventoryInfo(talker, 3) * 0.800000))
{
myself->ShowSystemMessage(talker, 1118);
return;
}
myself->GiveItem1(talker, 7832, num_coupon1);
myself->SetOneTimeQuestFlag(talker, 207, 1);
myself->ShowPage(talker, fnCoupon1Ok);
i0 = gg->GetNRMemoState(talker, 41);
myself->SetNRMemoState(talker, 41, i0 + 100);
gg->ShowOnScreenMsgStr(talker, 2, 0, 0, 0, 1, 0, 5000, 0, gg->MakeFString(4153, "", "", "", "", ""));
}
else
{
myself->ShowPage(talker, fnCoupon1Not2);
}
}
else
{
myself->ShowPage(talker, fnCoupon1Not1);
}
}
else
{
myself->ShowPage(talker, fnCoupon1Not1);
}
break;
}
case 2:
{
if (myself->IsInCategory(7, talker->occupation))
{
if (talker->level < 40)
{
if (myself->GetOneTimeQuestFlag(talker, 208) == 0)
{
if (myself->GetInventoryInfo(talker, 0) >= (myself->GetInventoryInfo(talker, 1) * 0.800000) || myself->GetInventoryInfo(talker, 2) >= (myself->GetInventoryInfo(talker, 3) * 0.800000))
{
myself->ShowSystemMessage(talker, 1118);
return;
}
myself->GiveItem1(talker, 7833, num_coupon2);
myself->SetOneTimeQuestFlag(talker, 208, 1);
myself->ShowPage(talker, fnCoupon2Ok);
}
else
{
myself->ShowPage(talker, fnCoupon2Not2);
}
}
else
{
myself->ShowPage(talker, fnCoupon2Not1);
}
}
else
{
myself->ShowPage(talker, fnCoupon2Not1);
}
break;
}
}
}
if (ask == -303)
{
switch (reply)
{
case 528:
case 530:
{
if (talker->level > 5)
{
if (talker->level < 20 && myself->IsInCategory(6, talker->occupation))
{
if (reply != 532 || reply != 549)
{
myself->ShowMultisell(reply, talker);
}
}
else if (reply >= 557 && reply <= 562)
{
if (myself->sm->class_id == 1032103)
{
myself->ShowMultisell(reply, talker);
}
}
else if (reply == 567)
{
if (myself->sm->class_id == 1032091)
{
myself->ShowMultisell(reply, talker);
}
}
else
{
myself->ShowPage(talker, fnCoupon1Not3);
}
}
else
{
myself->ShowPage(talker, fnCoupon1Not3);
}
break;
}
case 529:
case 531:
{
if (myself->IsInCategory(7, talker->occupation))
{
if (talker->level < 40)
{
if (reply != 532 || reply != 549)
{
myself->ShowMultisell(reply, talker);
}
}
else if (reply >= 557 && reply <= 562)
{
if (myself->sm->class_id == 1032103)
{
myself->ShowMultisell(reply, talker);
}
}
else if (reply == 567)
{
if (myself->sm->class_id == 1032091)
{
myself->ShowMultisell(reply, talker);
}
}
else
{
myself->ShowPage(talker, fnCoupon2Not3);
}
}
else
{
myself->ShowPage(talker, fnCoupon2Not3);
}
break;
}
}
}
}
EventHandler TELEPORT_REQUESTED(talker)
{
if (talker->level >= 20)
{
myself->ShowPage(talker, "guide_teleport_over001.htm");
}
else if (talker->transformID == 111 || talker->transformID == 112 || talker->transformID == 124)
{
myself->ShowPage(talker, "q194_noteleport.htm");
}
else
{
myself->Teleport(talker, Position, ShopName, "", "", "", 57, "");
}
}
}