• 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!

Solved TFS 0.3.6 to 0.4 some bugs needed to be fixed

Ray Rewind

Doctor
Joined
Jun 6, 2009
Messages
1,348
Reaction score
76
Location
Germany
Hello :)!

I have these bugs

a2ixYZv.png




cobsMXQ.png



Which needs to be fixed.

Lets start with the globalevent stuffs.

here is the script !


Code:
function onStartup()
db.executeQuery("UPDATE `player_storage` SET `value` = 0 WHERE `key` = " .. ZEA_isOnLMSArea .. ";")
db.executeQuery("UPDATE `player_storage` SET `value` = 0 WHERE `key` = " .. ZEA_JOIN .. ";")
doSetStorage(ZEA_STATUS, 0)
doSetStorage(ZEA_PLAYERS_NUMBER, ZEA_DEFAULT_NUMBER_OF_PLAYERS)
addLMSEventBlockEnterPosition()
return true
end


the other error is the functio naddskill and conjure food


this is the part of my conjured spells from spells.xml

Code:
    <!-- Conjure Spells -->
    <conjure name="Conjure Arrow" words="exevo con" lvl="13" mana="100" soul="1" conjureId="2544" conjureCount="10" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
        <vocation id="3"/>
        <vocation id="7"/>
    </conjure>
    <conjure name="Food" words="exevo pan" lvl="14" mana="120" soul="1" exhaustion="1000" needlearn="0" event="function" value="conjureFood">
        <vocation id="2"/>
        <vocation id="3"/>
        <vocation id="6"/>
        <vocation id="7"/>
    </conjure>
    <conjure name="Poisoned Arrow" words="exevo con pox" lvl="16" mana="130" soul="2" conjureId="2545" conjureCount="7" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
        <vocation id="3"/>
        <vocation id="7"/>
    </conjure>
    <conjure name="Conjure Bolt" words="exevo con mort" lvl="17" mana="140" soul="2" prem="1" conjureId="2543" conjureCount="5" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
        <vocation id="3"/>
        <vocation id="7"/>
    </conjure>
    <conjure name="Conjure Sniper Arrow" words="exevo con hur" lvl="24" mana="160" soul="3" prem="1" conjureId="7364" conjureCount="5" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
        <vocation id="3"/>
        <vocation id="7"/>
    </conjure>
    <conjure name="Explosive Arrow" words="exevo con flam" lvl="25" mana="290" soul="3" conjureId="2546" conjureCount="8" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
        <vocation id="3"/>
        <vocation id="7"/>
    </conjure>
    <conjure name="Conjure Piercing Bolt" words="exevo con grav" lvl="33" mana="180" soul="3" prem="1" conjureId="7363" conjureCount="5" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
        <vocation id="3"/>
        <vocation id="7"/>
    </conjure>
    <conjure name="Enchant Staff" words="exeta vis" lvl="41" mana="80" prem="1" conjureId="2433" reagentId="2401" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
        <vocation id="5"/>
    </conjure>
    <conjure name="Enchant Spear" words="exeta con" lvl="45" mana="350" soul="3" prem="1" conjureId="7367" reagentId="2389" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
        <vocation id="3"/>
        <vocation id="7"/>
    </conjure>
    <conjure name="Power Bolt" words="exevo con vis" lvl="59" mana="800" soul="4" prem="1" conjureId="2547" conjureCount="10" exhaustion="1000" needlearn="0" event="function" value="conjureItem">
        <vocation id="7"/>
    </conjure>
    <conjure name="Poison Field" words="adevo grav pox" lvl="14" mana="200" soul="1" reagentId="2260" conjureId="2285" conjureCount="3" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="1"/>
        <vocation id="2"/>
        <vocation id="5"/>
        <vocation id="6"/>
    </conjure>
    <conjure name="Light Magic Missile" words="adori min vis" lvl="15" mana="120" soul="1" reagentId="2260" conjureId="2287" conjureCount="10" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="1"/>
        <vocation id="2"/>
        <vocation id="5"/>
        <vocation id="6"/>
    </conjure>
    <conjure name="Fire Field" words="adevo grav flam" lvl="15" mana="240" soul="1" reagentId="2260" conjureId="2301" conjureCount="3" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="1"/>
        <vocation id="2"/>
        <vocation id="5"/>
        <vocation id="6"/>
    </conjure>
    <conjure name="Fireball" words="adori flam" lvl="27" mana="460" soul="3" prem="1" reagentId="2260" conjureId="2302" conjureCount="5" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="1"/>
        <vocation id="5"/>
    </conjure>
    <conjure name="Energy Field" words="adevo grav vis" lvl="18" mana="320" soul="2" reagentId="2260" conjureId="2277" conjureCount="3" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="1"/>
        <vocation id="2"/>
        <vocation id="5"/>
        <vocation id="6"/>
    </conjure>
    <conjure name="Stalagmite" words="adori tera" lvl="24" mana="400" soul="2" prem="2" reagentId="2260" conjureId="2292" conjureCount="10" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="1"/>
        <vocation id="5"/>
        <vocation id="2"/>
        <vocation id="6"/>
    </conjure>
    <conjure name="Great Fireball" words="adori mas flam" lvl="30" mana="530" soul="3" reagentId="2260" conjureId="2304" conjureCount="4" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="1"/>
        <vocation id="5"/>
    </conjure>
    <conjure name="Heavy Magic Missile" words="adori vis" lvl="25" mana="350" soul="2" reagentId="2260" conjureId="2311" conjureCount="10" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="1"/>
        <vocation id="5"/>
        <vocation id="2"/>
        <vocation id="6"/>
    </conjure>
    <conjure name="Poison Bomb" words="adevo mas pox" lvl="25" mana="520" soul="2" prem="1" reagentId="2260" conjureId="2286" conjureCount="2" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="2"/>
        <vocation id="6"/>
    </conjure>
    <conjure name="Firebomb" words="adevo mas flam" lvl="27" mana="600" soul="4" reagentId="2260" conjureId="2305" conjureCount="2" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="1"/>
        <vocation id="2"/>
        <vocation id="5"/>
        <vocation id="6"/>
    </conjure>
    <conjure name="Soulfire" words="adevo res flam" lvl="27" mana="600" soul="3" prem="1" reagentId="2260" conjureId="2308" conjureCount="3" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="1"/>
        <vocation id="2"/>
        <vocation id="5"/>
        <vocation id="6"/>
    </conjure>
    <conjure name="Poison Wall" words="adevo mas grav pox" lvl="29" mana="640" soul="3" reagentId="2260" conjureId="2289" conjureCount="4" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="1"/>
        <vocation id="2"/>
        <vocation id="5"/>
        <vocation id="6"/>
    </conjure>
    <conjure name="Explosion" words="adevo mas hur" lvl="31" mana="570" soul="4" reagentId="2260" conjureId="2313" conjureCount="6" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="1"/>
        <vocation id="2"/>
        <vocation id="5"/>
        <vocation id="6"/>
    </conjure>
    <conjure name="Fire Wall" words="adevo mas grav flam" lvl="33" mana="780" soul="4" reagentId="2260" conjureId="2303" conjureCount="4" exhaustion="1000" needlearn="0" event="function" value="conjureRune">
        <vocation id="1"/>
        <vocation id="2"/>
        <vocation id="5"/>
        <vocation id="6"/>
    </conjure>

Would somebody help me :)?
 
Add it as Lua script instead of function.

conjure food.lua
Code:
local FOODS = {
     2666, -- meat
     2671, -- ham
     2681, -- grape
     2674, -- aple
     2689, -- bread
     2690, -- roll
     2696 -- cheese
}

function onCastSpell(cid, var)
     local size = table.maxn(FOODS)
     if not doPlayerAddItem(cid, FOODS[math.random(1, size)]) then
         doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
         doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
       return false
     end

     if math.random(1, 100) > 50 then
         doPlayerAddItem(cid, FOODS[math.random(1, size)])
     end

     doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN)
     return true
end
 
Add it as Lua script instead of function.

conjure food.lua
Code:
local FOODS = {
     2666, -- meat
     2671, -- ham
     2681, -- grape
     2674, -- aple
     2689, -- bread
     2690, -- roll
     2696 -- cheese
}

function onCastSpell(cid, var)
     local size = table.maxn(FOODS)
     if not doPlayerAddItem(cid, FOODS[math.random(1, size)]) then
         doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
         doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
       return false
     end

     if math.random(1, 100) > 50 then
         doPlayerAddItem(cid, FOODS[math.random(1, size)])
     end

     doSendMagicEffect(getThingPosition(cid), CONST_ME_MAGIC_GREEN)
     return true
end


Thanks Limos this fixed my problem :)!

Only problem which is left is the mySQL problem I'm using Znote ACC

bKjQGh4.png
 
Code:
CREATE TABLE "guild_wars" (
   "id" INTEGER PRIMARY KEY NOT NULL,
   "guild_id" INTEGER NOT NULL,
   "enemy_id" INTEGER NOT NULL,
   "begin" INTEGER NOT NULL DEFAULT 0,
   "end" INTEGER NOT NULL DEFAULT 0,
   "frags" INTEGER NOT NULL DEFAULT 0,
   "payment" INTEGER NOT NULL DEFAULT 0,
   "guild_kills" INTEGER NOT NULL DEFAULT 0,
   "enemy_kills" INTEGER NOT NULL DEFAULT 0,
   "status" TINYINT NOT NULL DEFAULT 0,
   FOREIGN KEY ("guild_id") REFERENCES "guilds"("id"),
   FOREIGN KEY ("enemy_id") REFERENCES "guilds"("id")   
)
 
Code:
CREATE TABLE "guild_wars" (
   "id" INTEGER PRIMARY KEY NOT NULL,
   "guild_id" INTEGER NOT NULL,
   "enemy_id" INTEGER NOT NULL,
   "begin" INTEGER NOT NULL DEFAULT 0,
   "end" INTEGER NOT NULL DEFAULT 0,
   "frags" INTEGER NOT NULL DEFAULT 0,
   "payment" INTEGER NOT NULL DEFAULT 0,
   "guild_kills" INTEGER NOT NULL DEFAULT 0,
   "enemy_kills" INTEGER NOT NULL DEFAULT 0,
   "status" TINYINT NOT NULL DEFAULT 0,
   FOREIGN KEY ("guild_id") REFERENCES "guilds"("id"),
   FOREIGN KEY ("enemy_id") REFERENCES "guilds"("id")  
)


Thanks for your quick reply !

I already tried that getting this error in my DB


Fehler
SQL-Befehl:


CREATE TABLE "guild_wars" (
"id" INTEGER PRIMARY KEY NOT NULL,
"guild_id" INTEGER NOT NULL,
"enemy_id" INTEGER NOT NULL,
"begin" INTEGER NOT NULL DEFAULT 0,
"end" INTEGER NOT NULL DEFAULT 0,
"frags" INTEGER NOT NULL DEFAULT 0,
"payment" INTEGER NOT NULL DEFAULT 0,
"guild_kills" INTEGER NOT NULL DEFAULT 0,
"enemy_kills" INTEGER NOT NULL DEFAULT 0,
"status" TINYINT NOT NULL DEFAULT 0,
FOREIGN KEY ("guild_id") REFERENCES "guilds"("id"),
FOREIGN KEY ("enemy_id") REFERENCES "guilds"("id")
)



MySQL meldet:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"guild_wars" (
"id" INTEGER PRIMARY KEY NOT NULL,
"guild_id" INTEGER NOT' at line 1
 
Oh, this table is for SQLite, since it said SQLITE in the error.
Table for MySQL
Code:
CREATE TABLE `guild_wars` (
   `id` INT NOT NULL AUTO_INCREMENT,
   `guild_id` INT NOT NULL,
   `enemy_id` INT NOT NULL,
   `begin` BIGINT NOT NULL DEFAULT 0,
   `end` BIGINT NOT NULL DEFAULT 0,
   `frags` INT UNSIGNED NOT NULL DEFAULT 0,
   `payment` BIGINT UNSIGNED NOT NULL DEFAULT 0,
   `guild_kills` INT UNSIGNED NOT NULL DEFAULT 0,
   `enemy_kills` INT UNSIGNED NOT NULL DEFAULT 0,
   `status` TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
   PRIMARY KEY (`id`), KEY `status` (`status`),
   KEY `guild_id` (`guild_id`), KEY `enemy_id` (`enemy_id`),
   FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE,
   FOREIGN KEY (`enemy_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB;
 
Back
Top