View Full Version : Simple Charm To Give Player Money Every Update
Astal
09-05-2010, 05:23 PM
I cant seem to get it working, can anyone help?
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);
}
Astal
09-09-2010, 11:36 AM
bump anyone able to help? Still havent found a solution to this.
Akkadius
09-09-2010, 11:41 AM
I cant seem to get it working, can anyone help?
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.
Astal
09-09-2010, 11:48 AM
This should help a little.
hey thanks, sorry i forgot to update the code also
I was using this instead.
$client->AddMoneyToPP(0, 0, 0, $moneytogive, 1);
Astal
09-09-2010, 12:22 PM
hey thanks, sorry i forgot to update the code also
I was using this instead.
$client->AddMoneyToPP(0, 0, 0, $moneytogive, 1);
That doesnt work either however if i just input a value it does
#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
Astal
09-09-2010, 04:09 PM
That doesnt work either however if i just input a value it does
#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
joligario
09-09-2010, 04:34 PM
Maybe $client isn't passed?
cavedude
09-09-2010, 05:16 PM
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++.
Caryatis
09-09-2010, 05:37 PM
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).
Astal
09-10-2010, 12:59 PM
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
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.
Would be funny if it ended up many people couldn't walk if updates happened enough times while they was afking. :D
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.