Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 09-05-2010, 05:23 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default 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);

}
Reply With Quote
  #2  
Old 09-09-2010, 11:36 AM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

bump anyone able to help? Still havent found a solution to this.
Reply With Quote
  #3  
Old 09-09-2010, 11:41 AM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by Astal View Post
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.
Reply With Quote
  #4  
Old 09-09-2010, 11:48 AM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Quote:
Originally Posted by Akkadius View Post
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);
Reply With Quote
  #5  
Old 09-09-2010, 12:22 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Quote:
Originally Posted by Astal View Post
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
Reply With Quote
  #6  
Old 09-09-2010, 04:09 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Quote:
Originally Posted by Astal View Post
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
Reply With Quote
  #7  
Old 09-09-2010, 04:34 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Maybe $client isn't passed?
Reply With Quote
  #8  
Old 09-09-2010, 05:16 PM
cavedude's Avatar
cavedude
The PEQ Dude
 
Join Date: Apr 2003
Location: -
Posts: 1,988
Default

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++.
Reply With Quote
  #9  
Old 09-09-2010, 05:37 PM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 541
Default

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).
Reply With Quote
  #10  
Old 09-10-2010, 12:59 PM
Astal
Hill Giant
 
Join Date: Mar 2010
Posts: 236
Default

Quote:
Originally Posted by cavedude View Post
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 View Post
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.
Reply With Quote
  #11  
Old 09-10-2010, 06:34 PM
Hmm
Discordant
 
Join Date: Jan 2002
Posts: 276
Default

Would be funny if it ended up many people couldn't walk if updates happened enough times while they was afking.
__________________
Hmm...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 11:38 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3