Noob Guide on a few features for LOTF.

12/01/2008 22:11 Incariuz#1
Just to go over some basic changes that can be done to LOTF easily, but improve the gaming experience.

I was going to make an NPC guide to start, but... Then I figured, if you can't make an NPC, you're not gonna manage anything else. ><

So I'll begin with something simple. Let's say you suddenly decided to add Mobs to Metzone, what aspects of metzone do we need to account for?

-Higher Meteor drop rates.
-No using city gates.
-Reviving outside of metzone after death.

Just basic idea's, can't think of anything else right now. So first, we want the Meteors to drop more then everywhere else.

In Entities.cs, search for...

Code:
uint MoneyDrops = 0;
scroll down the code from there, and you'll see code similar to...

Code:
{
if (Other.ChanceSuccess(1))
   {
       string Item = "1060101-0-0-0-0-0";
       DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
       World.ItemDrops(item);
   }
}
Then below it add something like...

Code:
                    if (Name == "[COLOR="blue"]TreasureBird[/COLOR]")//reads MySql Database for monster name, that way only that monster drops the item at the new drop rate.
                    {
                        if (Other.ChanceSuccess([COLOR="blue"]5[/COLOR]))//the blue number is the drop rate.
                        {
                            string Item = "[COLOR="blue"]1088001[/COLOR]-0-0-0-0-0";//the blue number is the itemUID
                            DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                            World.ItemDrops(item);
                        }
                    }
Now for making sure people don't scroll out of Metzone. Not a complicated procedure, just an annoying one.

In Character.cs, search for...

Code:
else if (ItemParts[0] == "1060020")
{
        Teleport(1002, 429, 378);
        RemoveItem(ItemUID);
}
You'll want to make the CityGate so it's only usable in specific maps. Here's an exmple.

Code:
else if (ItemParts[0] == "1060020")
{
    [COLOR="Red"]if (LocMap == 1002 || LocMap == 1005)[/COLOR]
        Teleport(1002, 429, 378);
        RemoveItem(ItemUID);
}
For every map you want the scroll to be usable, simply add...

Code:
|| LocMap == MapID
onto the

Code:
if (LocMap == 1002 || LocMap == 1005)
And this way if your on a map which doesn't have it's ID specified in the city gates right click function, it will just remove the scroll, leaving you sitting in the same spot. ><

Note: You can also add right click options for other items in this section. Use your imagination, it's not difficult. But if you really can't figure it out, let me know and I'll give you some examples. -_-"

Now we want to make it so when someone dies... they don't revive in the exact same spot they're dead.

In DataBase.cs, go To...

Code:
public static void LoadRevPoints()
Now every time you add a revive map option here, you need to increase the blue number by 1.

Code:
RevPoints = new ushort[[COLOR="blue"]26[/COLOR]][];
Then scroll to the bottom of the list and add... (for this example, we'll make you revive in twin city after death.)

Code:
RevPoints[23] = new ushort[4] { [COLOR="Red"]1210[/COLOR], [COLOR="SeaGreen"]1002[/COLOR], [COLOR="Blue"]430[/COLOR], [COLOR="Blue"]380[/COLOR] };//Red is the map you're on. Green is the map you'll revive on.  Blue are the coordinates.
-----------------------------------------------------------------------

I know, it's nothing special, but I got bored, and there are bound to be people who don't have a clue how to do this, and will eventually ask.
12/01/2008 22:32 nTL3fTy#2
Just a note, it might be easier to specify which maps you cannot use a scroll on, the MetZone map for example. :p
12/01/2008 22:47 Incariuz#3
I attempted doing it that way myself. It didn't work oddly. I tried doing it simple to like let's say.

Code:
if (LocMap > 1000 && LocMap < 1209)
or

Code:
if (LocMap >= 1000 && LocMap <= 1209)
but the source wouldn't accept those. So this is the only working manner I've found with LOTF where that specific scenerio is concerned.
12/01/2008 23:07 nTL3fTy#4
What about
Code:
if (LocMap != 1210) { ... }
or
Code:
if (LocMap == 1210) { return; }
12/01/2008 23:17 Incariuz#5
Well the major issue is it wouldn't accept an else if, or else option for me to be able to have it read what maps weren't available (don't even ask why, cause it makes no sense to me either. It works in other item funtions for me, just not scrolls.), so therefor I had to use my displayed method so teleporting would actually be possible. I tried the options I showed you to try and save having to type every map, instead reading a range of maps to which the gate would work, but the source wouldn't accept those either. Who knows, maybe it's just my source being a complete pain in the ass. ><
12/02/2008 03:46 elragal_30#6
yes
u can make it like that
Quote:
if (LocMap == 1210) { return,or message sent "you can't use scroll here ,or make it remove item and do nothing "; }
then don't use else if
use
Quote:
if (LocMap!=1210 || LocMap!=6000,..etc)
{item do its use }
this remember me with Jail system to make it Don't let u out if GW on except it is xx:00 or xx:30
XD)
12/02/2008 10:51 alexbigfoot#7
Bad explained....
Code:
                    if (Name == "[COLOR="blue"]TreasureBird[/COLOR]")//[B]check if the mob that just died has the name "TreasureBird", no way reading it from mysql [/B]
                    {
                        if (Other.ChanceSuccess([COLOR="blue"]5[/COLOR]))//the blue number is the drop rate.
                        {
                            string Item = "[COLOR="blue"]1088001[/COLOR]-0-0-0-0-0";//[B]UID = unique id, with an unique id , u can find and item or anything somewhere, and an ID = in this case ItemID, that will be dropped ,totaly not the same[/B]
                            DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                            World.ItemDrops(item);
                        }
                    }
12/02/2008 14:04 Incariuz#8
Quote:
Originally Posted by alexbigfoot View Post
Bad explained....
Code:
                    if (Name == "[COLOR="blue"]TreasureBird[/COLOR]")//[B]check if the mob that just died has the name "TreasureBird", no way reading it from mysql [/B]
                    {
                        if (Other.ChanceSuccess([COLOR="blue"]5[/COLOR]))//the blue number is the drop rate.
                        {
                            string Item = "[COLOR="blue"]1088001[/COLOR]-0-0-0-0-0";//[B]UID = unique id, with an unique id , u can find and item or anything somewhere, and an ID = in this case ItemID, that will be dropped ,totaly not the same[/B]
                            DroppedItem item = DroppedItems.DropItem(Item, (uint)(PosX - General.Rand.Next(4) + General.Rand.Next(4)), (uint)(PosY - General.Rand.Next(4) + General.Rand.Next(4)), (uint)Map, MoneyDrops);
                            World.ItemDrops(item);
                        }
                    }
It reads the name TreasureBird from the monster you add to mysql. If I'm wrong, why does it work?

I use this method for making goldghosts, agile rats, and fiend bats in lab to drop the appropriate tokens for entering the next levels as lab aswell.

And what you said about the UID part made no sense to me what so ever.
12/02/2008 15:21 tanelipe#9
What you have described as UID is actually the Items ID, not UID.
12/03/2008 00:42 tao4229#10
UID != ItemID.

Conquer has a UID for everything, Items, Monsters, Characters, NPCs(Some people call it the NPCId, i still call it NPCUID).
12/03/2008 00:56 Incariuz#11
A well... I merely wanted to contribute a little something that may show a few newer coders around for some functions they may need to deal with on a number of cases. Turns out it was a pointless contribution.