PDA

View Full Version : How to evolve items using character flags and other means


Bellos
08-28-2010, 01:31 PM
Does anyone have an example script i could look at?

I have my charm evolving based on level but I have no idea how to do it based on anything else.

Any help would be appreciated.


Also, anyone know if its possible to evolve an item based on what items the player is wearing or has in his inventory?

Ok i found

GetItemAt(slot)

can this be used to get items inside backpacks or no?


Also do you have to specify the slot or can it be like GetItemAt(everyslotininventory) if so, how would i do that?


Edit: Ok this is what i have. Im fairly sure it wont work like I want it to but i cant think of anything else so maybe one of you guys can help me.

Basically it want it to scale up in stats based on how many of the rings of power the player has in his inventory.

#Ring of Thror

sub EVENT_SCALE_CALC {

#Setup Items In Slots
my $item1 = $client->GetItemAt(1);
my $item2 = $client->GetItemAt(2);
my $item3 = $client->GetItemAt(3);
my $item4 = $client->GetItemAt(4);
my $item5 = $client->GetItemAt(5);
my $item6 = $client->GetItemAt(6);

my $itemscale = 1;

#check slots for items
if($item1 == 2393 || $item2 == 2393 || $item3 == 2393 || $item4 == 2393 || $item5 == 2393 || $item6 == 2393) {
$questitem->SetScale($itemscale = $itemscale++);
}

if($item1 == 2415 || $item2 == 2415 || $item3 == 2415 || $item4 == 2415 || $item5 == 2415 || $item6 == 2415) {
$questitem->SetScale($itemscale = $itemscale++);
}

if($item1 == 2421 || $item2 == 2421 || $item3 == 2421 || $item4 == 2421|| $item5 == 2421 || $item6 == 2421) {
$questitem->SetScale($itemscale = $itemscale++);
}

}


Yeah it doesnt work at all lol

Bellos
08-31-2010, 07:22 AM
After a few days of work I figured this out so here is a script if anyone else wants to do this.

sub EVENT_SCALE_CALC {

my $itemscale = 1;

#check all slots for items
if(plugin::check_hasitem($client, 76094)) {
$itemscale = $itemscale + 2;
}

if(plugin::check_hasitem($client, 2393)) {
$itemscale = $itemscale + 2;
}

if(plugin::check_hasitem($client, 2421)) {
$itemscale = $itemscale + 2;
}

$questitem->SetScale($itemscale);

}

ChaosSlayerZ
04-28-2011, 04:18 PM
i have a follow up question - the code above, where do you set WHICH Charms specifically (item id?) you want this code apply to?

like i have 2 different charms. i want the code to work for one but not for the other?

lerxst2112
04-28-2011, 08:16 PM
The charmfile is the name of the perl file used to scale the item. They are in the quests/items directory. If you want two different effects, just make two files and assign them to the items.

ChaosSlayerZ
04-28-2011, 09:49 PM
ah, charmfile as the column entry in items table i take it?
perfect, thank you much!!! =)


2 more question about charms:

1. what determines what is charm MAX possible stats? do I put MIN stats on charm and they
add up with each scaleup +1?

2. let say I have a charm which scales with accordance to items you wearing.
So understand that stats will go up, but is it posible to put an effect on charm - like Focus or
regeneration, which will only activate
when it scaled up high enough?

KLS
04-28-2011, 10:16 PM
1. The stats on the item are the base you get scale * stat for those stats. Ex 25 STR charm with 0.5 modifier = 12STR, 1.0 = 25, 2.0 = 50.. etc etc.

2. No but it's possible in theory would require someone willing to add it to the code (don't look at me =p)

ChaosSlayerZ
04-28-2011, 10:40 PM
Oh KLS - this would be great!
think what can we achieve with it- SET ITEMS =)

You know like in Diablo 2, WoW and EQ2, when you collect a full set of specific items you get bonus effect? So a charm could be set to give you a unique bonus - Focus, Click effect, but only if you are wearing full set ;)