What's new

Creaturescripts [KONKURS][MOD] Bonus Exp

Status
Not open for further replies.

Sheyki

Advanced User
Joined
Jan 23, 2011
Messages
188
Reaction score
8
Prosty skrypt dodaj?cy bonusowe do?wiadczenie po zabiciu potwora. Dostajemy mi?dzy x% a y% dodatkowego expa i mamy z% szans na to, ?e je wgl dostaniemy.

PHP:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Bonus Exp" version="1.0" author="Sheyki" contact="GG: 7050674" enabled="yes">
	<config name="cfg"><![CDATA[
		cfgBExp = {
			bonusMin = 5, -- min % of bonus
			bonusMax = 15, -- max % of bonus
			bonusChance = 50 -- chance to get bonus
		}
	]]></config>
	<!-- Bonus Experience (registering event) -->
	<event type="login" name="PlayerLogin" event="script"><![CDATA[
	function onLogin(cid)
		registerCreatureEvent(cid, "BonusExp")
	return TRUE
	end
	]]></event>
	<!-- Bonus Experience -->
	<event type="kill" name="BonusExp" event="script">  <![CDATA[
	domodlib('cfg')	
	function onKill(cid, target)
		if math.random(1, 100) <= cfgBExp.bonusChance then
			local bexp = getMonsterInfo(getCreatureName(target)).experience*math.random(cfgBExp.bonusMin, cfgBExp.bonusMax)/100
			local bexpC = math.ceil(bexp)
			doPlayerAddExperience(cid, bexpC)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, bexpC .." bonus experience!")
		end
	return TRUE
	end
	]]></event>
</mod>
bexppng_npenpsa.png


Zabraniam kopiowania zawarto?ci na inne fora/serwisy.

Notka moderatorska:
+10 pkt do konkursu!
 

PuzeeL

Active User
Joined
Nov 23, 2012
Messages
113
Reaction score
4
Odp: [KONKURS]
Notka moderatorska:
Bonus Exp

No przyznam ?e fajny modzik, zapewne go u?yje :)
Pozdrawiam.
 

amperos

User
Joined
Oct 8, 2010
Messages
29
Reaction score
1
Odp: [KONKURS]
Notka moderatorska:
Bonus Exp

Bardzo fajne .Pozdrawiam
 
Status
Not open for further replies.
Top