Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-26-2019, 07:40 PM
rudeboy88's Avatar
rudeboy88
Sarnak
 
Join Date: Oct 2007
Location: West Freeport
Posts: 46
Default

Did a little cleanup today same script just a little shorter:

Code:
function event_say(e)
	if (e.message:findi("hail")) then
		e.other:Message(315, "Hail and well met mighty adventurer!  If you would like to [" .. eq.say_link("exchange",false,"exchange") .. "] platinum for credit, cash [" .. eq.say_link("out",false,"out") .. "], or know how much [" .. eq.say_link("credit",false,"credit") .. "] you have, I can help you with that.");
	elseif (e.message:findi("exchange")) then
		e.other:Message(315,"If you hand me platinum, I will convert it into credit.  Your money will be safe with me, but you can always cash [" .. eq.say_link("out",false,"out") .. "] if you'd like.");
	elseif (e.message:findi("credit")) then
		local a = eq.get_data(e.other:AccountID() .. "_Casino");
		e.other:Message(315,"Your current balance is " .. a ..".");
	elseif (e.message:findi("out")) then
		local b = eq.get_data(e.other:AccountID() .. "_Casino");
		e.other:GiveCash(0, 0, 0, tonumber(b));
		eq.set_data(e.other:AccountID() .. "_Casino", '0');
		e.other:Message(315,"Your balance has been cleared.  Enjoy the rest of your stay!");
	end
end

function event_trade(e)
	local item_lib = require("items");
	if(e.trade.platinum ~= 0 and e.trade.platinum ~= nil) then
		local c = e.trade.platinum;
		local d = eq.get_data(e.other:AccountID() .. "_Casino");
		local e = c + d;
		eq.set_data(e.other:AccountID() .. "_Casino", tostring(e));
		e.other:Message(315,"Your platinum has been credited to your character.  Current Balance: " .. eq.get_data(e.other:AccountID() .. "_Casino") .. ".");
	end
	item_lib.return_items(e.self, e.other, e.trade);
end
__________________
Discord: 1augher | Dev, Darkonites
Reply With Quote
 


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 06:41 PM.


 

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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3