FOnline Development > General Discussion
How to get mercenaries in the FOnline SDK?
Janusz2238:
You must implement prices by yourself.
Choose NPC in NCR, and edit his dialog file(Server/Dialogs). To edit dialog you use(/Server/Tools/DialogEditor).
You must add result script, I show it in last post.
BlindMaster:
How to chose an answer?
or dialog node?
Surf:
A good start would be to open the dialogeditor.
Cactus:
Heya, i was just wondering.. i need a way to set the AI to the merc. I can spawm him and he follows me only in local map.
Ive found that merc.fos is the main script for him and it includes merc dialog and all.
So there must be a way to link "merc.fos" or the AI to him.
At least a way to include it as a new AI package
Thanks
muhoooool:
Hello!
Here is the scrip edit for proper mercs!
These guys attck and defend.
--- Code: ---#include "_defines.fos"
#include "_npc_pids.fos"
import bool GetFreeHex(Map& map, uint radius, uint16& hx, uint16& hy) from "caravan";
import void r_AddMerc2Player(Critter & player, Critter @ npc) from "merc";
// Dialog result
void r_AddMercenary(Critter& player, Critter@ npc)
{
Map @mapa = player.GetMap();
if(@mapa!=null)
{
uint16 hX = player.HexX;
uint16 hY = player.HexY;
GetFreeHex(mapa, 1, hX, hY);
Critter@ merc = mapa.AddNpc(NPC_PID_MercenaryMale, hX, hY, player.Dir,null,null,null); // NPC_PID IS NPC FROM _npc_pids.fos /server/scripts
r_AddMerc2Player(player, merc);
merc.Say(SAY_NORM_ON_HEAD, "Yessir");
merc.StatBase[ ST_AI_ID ] = 55; // AI OF NPC FROM _ai.fos /server/scripts ( set to vic defensive )
merc.StatBase[ ST_TEAM_ID ] = 0; // TEAM FROM _teams.fos ... set to plyer?
merc.StatBase[ ST_DIALOG_ID ] = 30000; // DIALOG
merc.MercBase[ MERC_DEFEND_MASTER ] = 1;
merc.MercBase[ MERC_ALWAYS_RUN ] = 1;
merc.MercBase[ MERC_ASSIST_MASTER ] = 1;
merc.MercBase[ MERC_CANCEL_ON_ATTACK ] = 1;
merc.SetScript( "merc@_MercInit" );
}
}
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version