|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
09-05-2010, 05:23 PM
|
Hill Giant
|
|
Join Date: Mar 2010
Posts: 236
|
|
Simple Charm To Give Player Money Every Update
I cant seem to get it working, can anyone help?
Code:
sub EVENT_SCALE_CALC {
my $currentmoney = $client->GetPlatinum();
my $moneytogive = $currentmoney / 100 ;
my $itemscale = 1;
#check all slots for items
if(plugin::check_hasitem($client, 2415)) {
$itemscale = $itemscale + 2; #scale charm up by 1 per item
}
if(plugin::check_hasitem($client, 2421)) {
$itemscale = $itemscale + 2;
}
if(plugin::check_hasitem($client, 2393)) {
$itemscale = $itemscale + 2;
}
$questitem->SetScale($itemscale);
AddMoneyToPP(0, 0, 0, $moneytogive, 1);
}
|
09-09-2010, 11:36 AM
|
Hill Giant
|
|
Join Date: Mar 2010
Posts: 236
|
|
bump anyone able to help? Still havent found a solution to this.
|
09-09-2010, 11:41 AM
|
|
Administrator
|
|
Join Date: Feb 2009
Location: MN
Posts: 2,071
|
|
Quote:
Originally Posted by Astal
I cant seem to get it working, can anyone help?
Code:
sub EVENT_SCALE_CALC {
my $currentmoney = $client->GetPlatinum();
my $moneytogive = $currentmoney / 100 ;
my $itemscale = 1;
#check all slots for items
if(plugin::check_hasitem($client, 2415)) {
$itemscale = $itemscale + 2; #scale charm up by 1 per item
}
if(plugin::check_hasitem($client, 2421)) {
$itemscale = $itemscale + 2;
}
if(plugin::check_hasitem($client, 2393)) {
$itemscale = $itemscale + 2;
}
$questitem->SetScale($itemscale);
quest::givecash(0,0,0,$moneytogive);
}
|
This should help a little.
|
09-09-2010, 11:48 AM
|
Hill Giant
|
|
Join Date: Mar 2010
Posts: 236
|
|
Quote:
Originally Posted by Akkadius
This should help a little.
|
hey thanks, sorry i forgot to update the code also
I was using this instead.
Code:
$client->AddMoneyToPP(0, 0, 0, $moneytogive, 1);
|
09-09-2010, 12:22 PM
|
Hill Giant
|
|
Join Date: Mar 2010
Posts: 236
|
|
Quote:
Originally Posted by Astal
hey thanks, sorry i forgot to update the code also
I was using this instead.
Code:
$client->AddMoneyToPP(0, 0, 0, $moneytogive, 1);
|
That doesnt work either however if i just input a value it does
Code:
#Ring of Thror
sub EVENT_SCALE_CALC {
#my $currentmoney = $client->GetPlatinum();
#my $moneytogive = $currentmoney / 100 ;
my $itemscale = 1;
#check all slots for items
if(plugin::check_hasitem($client, 2415)) {
$itemscale = $itemscale + 2; #scale charm up by 1 per item
}
if(plugin::check_hasitem($client, 2421)) {
$itemscale = $itemscale + 2;
}
if(plugin::check_hasitem($client, 2393)) {
$itemscale = $itemscale + 2;
}
$questitem->SetScale($itemscale);
quest::givecash(0,0,0,1);
}
It must be the lines in red, ill have to check em out, i know i have em commented out, i did that on purpose because they dont work
|
09-09-2010, 04:09 PM
|
Hill Giant
|
|
Join Date: Mar 2010
Posts: 236
|
|
Quote:
Originally Posted by Astal
That doesnt work either however if i just input a value it does
Code:
#Ring of Thror
sub EVENT_SCALE_CALC {
#my $currentmoney = $client->GetPlatinum();
#my $moneytogive = $currentmoney / 100 ;
my $itemscale = 1;
#check all slots for items
if(plugin::check_hasitem($client, 2415)) {
$itemscale = $itemscale + 2; #scale charm up by 1 per item
}
if(plugin::check_hasitem($client, 2421)) {
$itemscale = $itemscale + 2;
}
if(plugin::check_hasitem($client, 2393)) {
$itemscale = $itemscale + 2;
}
$questitem->SetScale($itemscale);
quest::givecash(0,0,0,1);
}
It must be the lines in red, ill have to check em out, i know i have em commented out, i did that on purpose because they dont work
|
#my $currentmoney = $client->GetPlatinum();
no such thing, i dunno why the example i found used it. Oh well
|
09-09-2010, 04:34 PM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,490
|
|
Maybe $client isn't passed?
|
09-09-2010, 05:16 PM
|
|
The PEQ Dude
|
|
Join Date: Apr 2003
Location: -
Posts: 1,988
|
|
GetPlatinum() is a member of NPC and Corpse. It probably needs to be a member of Mob to work with $client. I doubt it would take much to export it to Mob if you know some C++.
|
09-09-2010, 05:37 PM
|
Dragon
|
|
Join Date: May 2009
Location: Milky Way
Posts: 541
|
|
Wouldn't this code just result in infinite money generation? If it gives plat every update, couldn't the player just remove an item(say 2415), zone, then reequip, zone, etc, etc... Possibly wouldn't even have to zone(I know you need to zone for the stats to update client side but not sure if it would execute the addmoney every time you added a piece of gear).
|
|
|
|
09-10-2010, 12:59 PM
|
Hill Giant
|
|
Join Date: Mar 2010
Posts: 236
|
|
Quote:
Originally Posted by cavedude
GetPlatinum() is a member of NPC and Corpse. It probably needs to be a member of Mob to work with $client. I doubt it would take much to export it to Mob if you know some C++.
|
Yeah i noticed that. Unfortuntely i dont know enough C++. Im just gonna have it add 1 pp per update so the player doesnt get too much.
Damn it seems i would need to do that to do my other idea also id need to pass CastSpell(spell_id, target_id, slot= 10, casttime= -1, mana_cost= -1)
to the client some how. Then i could cast a spell every update since i dont see anything for updating spells on charmfile items. That may get retarded though, casting a spell every minute.
Actually this would work quest::selfcast(spellid) - Forces client to cast spell on themself (useful for self only and group effect spells).
I still think it would get icky if 100 players are constantly self casting every one minute lol I guess I could set a global variable expires in 60 minutes and have it recast every 60. I may try that
Quote:
Originally Posted by Caryatis
Wouldn't this code just result in infinite money generation? If it gives plat every update, couldn't the player just remove an item(say 2415), zone, then reequip, zone, etc, etc... Possibly wouldn't even have to zone(I know you need to zone for the stats to update client side but not sure if it would execute the addmoney every time you added a piece of gear).
|
Im not sure what you mean. Your saying the player will get the money even if they dont have the item?
Yes it results in infinite money generation. You get 1 platinum per update at the moment. If i can figure out a way to add a seperate update function then i will be able to raise the amount of PP generated but any more than 1pp per minute gets over powered esp if the player plays alot.
Hey question while im here.
Is it possible to add a worn or clicky spell to an item via charmfile? Like the item has a spell on it but i wanna upgrade the spell along with the charm.
|
|
|
|
09-10-2010, 06:34 PM
|
Discordant
|
|
Join Date: Jan 2002
Posts: 276
|
|
Would be funny if it ended up many people couldn't walk if updates happened enough times while they was afking.
__________________
Hmm...
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 11:38 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|