FOnline Development > General Discussion

How to get mercenaries in the FOnline SDK?

<< < (2/5) > >>

Ulrek:

--- Quote from: Wipe on April 13, 2011, 01:57:22 am ---This are only param numbers; check most obvious - merc.fos and q_npc_v13_dclaw.fos as an example of use. Eventually look for "Merc2Player" in other *.fos files.

--- End quote ---

Alright, thanks.

-Ulrek-

Janusz2238:
I write simple function for you. If you call it from dialog, you will get merc. I dond check any demand, so you can use it for build some more complex function. If you build more code, share with others.


--- 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_BountyHunter_10,  hX, hY, player.Dir,null,null,null);
r_AddMerc2Player(player, merc);
merc.Say(SAY_NORM_ON_HEAD, "I will save your ass Ulrek boy");
}
}

--- End code ---

Ulrek:
Alright, if i manage to create something more complex i'd be happy to share.

And once again thank you.

-Ulrek-

Janusz2238:
No problem. If someone else woudl use this code, I write instruction "just in case":
- make new script, and paste code from post; (file: your_script_file_name.fos)
- add script to scripts.cfg
--- Quote ---@ server module your_script_file_name      
--- End quote ---
- add to dialog, result function(via dialog editor):
--- Code: ---your_script_file_name@r_AddMercenary
--- End code ---

Jimmy BoyX:
What mercenaries do I get? How it work? Can I make example in NCR mercenaries Rangers and in Navarro Enclave guys? What about prices?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version