How to Add a BCNM

From DSP Wiki
Revision as of 22:31, 12 October 2013 by Demolish (Talk | contribs)

Jump to: navigation, search

In this page we will learn how to add BCNMs. Why? Well you should have thought about that before coming here.

Adding the BCNM to the list

To start off, navigate to your dsp folder and then to /scripts/globals/ and open bcnm.lua

Inside you'll see something like this:

itemid_bcnmid_map = { 6,{0,0},--Bearclaw_Pinnacle
                     17,{0,0},--spire of holla
		     19,{0,0},--spire of dem
		     21,{0,0},--spire of mea

Unless you're adding a BCNM that requires an item trade, the above will be of no use. You should scroll down to this instead:

bcnmid_param_map = { 6,{640,0},

This may seem confusing at first glance but it's not! Here's a breakdown of it:

bcnmid_param_map = {

The first number (in our case 6) is the ZoneID. The first pair of numbers after the ZoneID are the bcnmid and paramid (which must always be in pairs).

6, <- Zone ID {640 <- bcnmid , 0 <- paramid }

The bcnmid can be found in the bcnm_info sql file / table.

The paramid can usually be found commented in the BCNM zone's Burning_Circle.lua file e.g.

-- Area: Balga's Dais
-- NPC:  Burning Circle
-- Balga's Dais Burning Circle
-- @pos 299 -123 345 146
package.loaded["scripts/zones/Balgas_Dais/TextIDs"] = nil;
package.loaded["scripts/globals/bcnm"] = nil;

	---- 0: Rank 2 Final Mission for Bastok "The Emissary" and Sandy "Journey Abroad" <--- This line <---
	---- 1: Steamed Sprouts (BCNM 40, Star Orb)
	---- 2: Divine Punishers (BCNM 60, Moon Orb)
	---- 3: Saintly Invitation (Windurst mission 6-2)
	---- 4: Treasure and Tribulations (BCNM 50, Comet Orb)

In our case, if the BCNM we were adding was for Rank 2 Final Mission in Balga's Dais, we could use the information from bcnm_info:

[bcnmid | zoneId |      name      ]
[  96   |   146  | rank_2_mission ]

In bcnm.lua with 96 being bcnmid and 0 being the paramid.

bcnm_param_map = {

IMPORTANT: You do not need to create another line for an existing zone's bcnm, simply add the bcnmid and paramid at the end of the zone's array (don't include the -->'s, they're there simply to make things easier to understand)

bcnm_param_map = {
                  146,{bcnmid --> 96, paramid --> 0, bcnmid --> 99, paramid --> 3},

Just a summary of this section;

bcnm_param_map = {
                 146, {  96  ,   0   ,   99  ,   3    },
         --   zoneid, {bcnmid,paramid, bcnmid, paramid},

Adding mobs to the BCNM

In this section we'll be adding mobs to the BCNM. To do this you'll need to have the monsterId which you can find from the mobid column mob_spawn_points table/sql file. Add this into the bcnm_instance.sql file so it looks like this (if it were for Rank 2 Mission)

[ bcnmId | instanceNumber | monsterId | conditions ]
|   0    |       1        | 17346561  |     3      |

For the mob to show up, you'll need the mob's x,y,z,rotation pos in the mob_spawn_points table/sql file:

[   mobid   |     mobname     | groupid |    pos_x   |    pos_y   |    pos_z  |   pos_rot  ]
|  17375233 |	Black_Dragon  |	  7900  |    -138    |	   56	  |    -224   |     189    |  
                                             ~X^           Y^           Z^        rotation^ ~                             

To set the pos you'll need access to a retail FFXI where you can pull the @pos co-ordinates. If you don't have access to retail FFXI, you can find a video with the BCNM fight and estimate the pos for the bcnm mobs.

When attempting to estimate the co-ordinates (x,y,z,rotation) you'll first need to assign a mob to the bcnmid and then go to the BCNM. Once you've entered the BCNM place your character at each of the mob's estimated spawn points and type @where. The [ x,y,z,(rotation) ] co-ordinates shown from @where need to go in mob_spawn_points table/sql file.

When all the information needed is added to bcnm_instance table/sql, re-import the sql file or save changes to table and reboot DSGameServer. Make sure you've added all mobs that need to be in the BCNM and got the correct co-ordinates.

Adding requirements to the BCNM

In this section we'll be adding requirements such as Key Item or Mission requirements to the BCNM. This is the easiest and least time consuming part of adding a BCNM. Simply add the condition you need in bcnm.lua under

function checkNonTradeBCNM(player,npc)

Here you can see the bcnm first checks the Zone, if the player has the Key Item required for it, sets the id, mask and sets the var needed.

elseif(Zone == 146) then -- Balga's Dais
		if(player:hasKeyItem(DARK_KEY)) then -- Mission 2-3
			mask = GetBattleBitmask(96,Zone,1);

You don't need another 'elseif(Zone == )' if adding another bcnm to a zone that already has one. Just add the check like so:

elseif(Zone == 146) then -- Balga's Dais
		if(player:hasKeyItem(DARK_KEY)) then -- Mission 2-3
			mask = GetBattleBitmask(96,Zone,1);
		elseif(player:hasKeyItem(HOLY_ONES_INVITATION)) then -- Mission 6-2
			mask = GetBattleBitmask(99,Zone,1);