• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Waters Elemntals and Fishing Rod.

QuaS

Cykotitan Pwned =/
Joined
Sep 11, 2008
Messages
838
Reaction score
28
Location
Poland/ Wroclaw
Hello! Today i will give you script to fishing rod, what will allow you to get items from dead water elementals ;)

Here we go:

enter data/actions/scripts/tools/fishing.lua

And replace all code there to:
Lua:
local config = {
	waterIds = {493, 4608, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625},
	rateSkill = getConfigValue("rateSkill"),
	allowFromPz = false,
	useWorms = true
}

--water elementals config
local find_anything = 30 -- chance to find anything.
local difficulty = 40 -- 1-100 range for difficulty. The higher it is, the less likely it is that player will get a good item

local items = {
[10499] = {2238, 2226, 2148, 2376, 2509, 2168, 7588, 7589, 2152, 2146, 2149, 2169, 7632, 7633, 9811, 9808, 8764, 10220}, -- normal water and massive. I noticed that they are the same one.(based on tibiawikia) QuaS
}
function onUse(cid, item, fromPosition, itemEx, toPosition)

    	if items[itemEx.itemid] ~= nil then
	      if math.random(100) <= find_anything then
  			doTransformItem(itemEx.uid, 2016)
			doDecayItem(itemEx.uid)
			doSendMagicEffect(toPosition, 1)
		else
			local geti = items[itemEx.itemid]
			local newId
			for i = 1, #items[itemEx.itemid] do
				local x = math.random(100)
				                	if (x < difficulty) then
                    					newId = geti[i]
                   					break
							elseif (i >= #items[itemEx.itemid]) then 
                    					newId = geti[#items[itemEx.itemid]]
                					end    
          		end

  			doTransformItem(itemEx.uid, 2016)
			doPlayerAddItem(cid, newId, 1)
			doSendMagicEffect(toPosition, 1)

		end
	end

	if(not isInArray(config.waterIds, itemEx.itemid)) then
		return false
	end

	if((config.allowFromPz or not getTileInfo(getCreaturePosition(cid)).protection) and itemEx.itemid ~= 493 and
		math.random(1, (100 + (getPlayerSkill(cid, SKILL_FISHING) / 10))) < getPlayerSkill(cid, SKILL_FISHING) and
		(not config.useWorms or (getPlayerItemCount(cid, ITEM_WORM) > 0 and doPlayerRemoveItem(cid, ITEM_WORM, 1)))) then
		doPlayerAddItem(cid, ITEM_FISH, 1)
		doPlayerAddSkillTry(cid, SKILL_FISHING, config.rateSkill)
	end

	doSendMagicEffect(toPosition, CONST_ME_LOSEENERGY)
	return true
end

Now elemntals. Enter data/monster/hydro-elemntals/

Open water elemental.xml. Put there(i just changed corpse to 10499):
PHP:
<?xml version="1.0" encoding="UTF-8"?>
  <monster name="Water Elemental" nameDescription="a Water Elemental" race="undead" experience="450" species="ice" speed="280" manacost="0">
    <health now="550" max="550"/>
    <look type="286" corpse="10499"/>
    <targetchange interval="20000" chance="15"/>
    <strategy attack="100" defense="0"/>
    <flags>
      <flag summonable="0"/>
      <flag attackable="1"/>
      <flag hostile="1"/>
      <flag illusionable="0"/>
      <flag convinceable="0"/>
      <flag pushable="0"/>
      <flag canpushitems="1"/>
      <flag staticattack="85"/>
      <flag lightlevel="0"/>
      <flag lightcolor="0"/>
      <flag targetdistance="1"/>
      <flag runonhealth="1"/>
    </flags>
    <attacks>
    <attack name="melee" interval="2000" skill="75" attack="65"/>
    <attack name="earth" interval="2000" chance="20" range="7" target="1" min="0" max="-120">
    <attribute key="shootEffect" value="earth"/>
	<attribute key="areaEffect" value="smallplants"/>
    </attack>
    <attack name="physical" interval="1000" chance="10" range="6" target="1" min="0" max="-209">
	<attribute key="shootEffect" value="snowball"/>
	</attack>
    <attack name="ice" interval="2000" chance="18" range="4" target="1" min="0" max="-103">
    <attribute key="shootEffect" value="smallice"/>
    </attack>
    <attack name="physical" interval="1000" chance="9" range="7" radius="2" target="1" min="0" max="-240">
    <attribute key="shootEffect" value="smallice"/>
    <attribute key="areaEffect" value="giantice"/>
    </attack>
</attacks>
    <defenses armor="30" defense="30">
    <defense name="healing" interval="2000" chance="15" min="90" max="150">
      <attribute key="areaEffect" value="blueshimmer"/>
    </defense>
  </defenses>
<elements>
		<element physicalPercent="70"/>
		<element energyPercent="-25"/>
		<element holyPercent="20"/>
		<element deathPercent="30"/>
</elements>
  <immunities>
    <immunity ice="1"/>
    <immunity fire="1"/>
    <immunity poison="1"/>
    <immunity paralyze="1"/>
    <immunity invisible="1"/>
  </immunities>
  </monster>

now massive water elemental.xml

PHP:
<?xml version="1.0" encoding="UTF-8"?>
  <monster name="Massive Water Elemental" nameDescription="a Massive Water Elemental" race="undead" experience="1950" species="ice" speed="390" manacost="0">
    <health now="2350" max="2350"/>
    <look type="11" corpse="10499"/>
    <targetchange interval="20000" chance="15"/>
    <strategy attack="100" defense="0"/>
    <flags>
      <flag summonable="0"/>
      <flag attackable="1"/>
      <flag hostile="1"/>
      <flag illusionable="0"/>
      <flag convinceable="0"/>
      <flag pushable="0"/>
      <flag canpushitems="1"/>
      <flag staticattack="85"/>
      <flag lightlevel="0"/>
      <flag lightcolor="0"/>
      <flag targetdistance="1"/>
      <flag runonhealth="1"/>
    </flags>
<attacks>
    <attack name="melee" interval="2000" skill="75" attack="65"/>
<attack name="earth" interval="2000" chance="18" radius="6" target="0" min="-55" max="-320">
	<attribute key="areaEffect" value="poison"/>
    </attack>
<attack name="ice" interval="2000" chance="21" radius="2" target="1" min="-290" max="-420">
    <attribute key="areaEffect" value="bluebubble"/>
	<attribute key="shootEffect" value="snowball"/>
    </attack>
    <attack name="ice" interval="1000" chance="12" range="7" target="1" min="-190" max="-230">
    <attribute key="shootEffect" value="smallice"/>
    <attribute key="areaEffect" value="iceattack"/>
    </attack>
</attacks>
    <defenses armor="30" defense="30">
    <defense name="healing" interval="2000" chance="15" min="90" max="150">
      <attribute key="areaEffect" value="blueshimmer"/>
    </defense>
  </defenses>
<elements>
		<element physicalPercent="50"/>
		<element energyPercent="-15"/>
		<element earthPercent="100"/>
		<element icePercent="100"/>
		<element holyPercent="30"/>
		<element deathPercent="60"/>
</elements>
  <immunities>
    <immunity physical="0"/>
    <immunity energy="0"/>
    <immunity fire="1"/>
    <immunity poison="0"/>
    <immunity lifedrain="1"/>
    <immunity paralyze="1"/>
    <immunity outfit="1"/>
    <immunity drunk="1"/>
    <immunity invisible="1"/>
  </immunities>
  </monster>


And the last one. Open data/items/items.xml and add line:

PHP:
	<item id="10499" article="a" name="any name">
		<attribute key="decayTo" value="2016"/>
		<attribute key="duration" value="120"/>
	</item>

And it is all...


Yours QuaS~
 
Lol nice, but I don't think people think about that. But good job!
 
Back
Top