• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Red skulls take 50% more damage.

Nightimarez

New Member
Joined
Jul 24, 2008
Messages
287
Reaction score
2
Does anyone know how to script something so when players have a red skull, they take 50% more damage?
Something kinda like this.

PHP:
if (getCreatureSkullType(cid)  >= 4) then
absorb -50 of total damage?
 
not tested, but, try this..
Code:
function onStatsChange(cid, attacker, type, combat, value)
	if(not isPlayer(cid)) then
		return true
	end
	
	if type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) and getCreatureSkill(cid) == SKULL_RED and value > 0 then
		doCreatureAddHealth(cid, -(value*0.5))
	end
	
	return true
end
 
Code:
[14/06/2012 17:39:31] [Error - CreatureEvent::configureEvent] No valid type for creature event.statschange
[14/06/2012 17:39:31] Warning: [BaseEvents::loadFromXml] Can not configure event

I'm using the latest mystic spirit server.
 
Code:
[14/06/2012 17:39:31] [Error - CreatureEvent::configureEvent] No valid type for creature event.statschange
[14/06/2012 17:39:31] Warning: [BaseEvents::loadFromXml] Can not configure event

I'm using the latest mystic spirit server.

I don't think Mystic Spirit has this function (onStatsChange). You'll need to use "0.3.7" if you wish to use this script. I recommend you switch as well. TFS 0.2 is more of a foundation to build upon, and TFS 0.3.7 is more of a "built-up" foundation, which needs less work to host. In other words, it'll be easier for "newbies". Long-term, I would recommend using 0.2 (if you have the knowledge and willingness to devote many more hours of work toward the server), because while TFS 0.3.7 is a great server, it's still in development. But if you're a Premium user, access to updates are available - 0.3.7 is the way to go!
 
Last edited:
Alright, well can you help me with this then.

PHP:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
        if getCreatureSkill(cid) == SKULL_RED then
                doSetCreatureDropLoot(cid, false)
			doPlayerAddLevel(cid, -10)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You lost 10 levels for dying with red skull.")
else
                doSetCreatureDropLoot(cid, false)
        end
        return true
        end
        return true
        end

I didn't script it right, but the idea is.. if you have the amulet 2196, you don't lose items. But if you're red skull, you lose 10 levels, but you still don't lose items. I'm trying to make people fight much less on my server.

PHP:
[14/06/2012 17:56:00] data/creaturescripts/scripts/aol.lua:onPrepareDeath
[14/06/2012 17:56:00] data/creaturescripts/scripts/aol.lua:3: attempt to call global 'getCreatureSkill' (a nil value)
[14/06/2012 17:56:01] stack traceback:
[14/06/2012 17:56:01] 	[C]: in function 'getCreatureSkill'
[14/06/2012 17:56:01] 	data/creaturescripts/scripts/aol.lua:3: in function <data/creaturescripts/scripts/aol.lua:1>
 
Last edited:
PHP:
function onPrepareDeath(cid, lastHitKiller, mostDamageKiller)
if (getPlayerSlotItem(cid, CONST_SLOT_NECKLACE).itemid == 2196) then
        if getCreatureSkull(cid) == SKULL_RED then
                doSetCreatureDropLoot(cid, false)
            doPlayerAddLevel(cid, -10)
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You lost 10 levels for dying with red skull.")
else
                doSetCreatureDropLoot(cid, false)
        end
        return true
        end
        return true
        end

XDDD
 
Back
Top