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

Lua Spell Effect

metiu11

Member
Joined
Mar 26, 2011
Messages
94
Solutions
2
Reaction score
5
Hello, I wanna add new effect spell. So i add it in Object Builder - effects
Imgur: The magic of the Internet
So this number its 70.
This is my spell code:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)

setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -50.2, 1, -50.2, 1)

function onCastSpell(cid, var)
local position1 = {x=getThingPosition(getCreatureTarget(cid)).x, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z}
doSendMagicEffect(position1, 69)
return doCombat(cid, combat, var), setCooldown(cid, "oodama rasengan", 10)
end

but it doesnt work, you cant see the effect, i dont know why... i tried to change effect number like 50, 40, 36, etc. and it works.
I observed something strange... If i add numbers 69, 70, 71, 72... I cant see effects.
But if i add numbers 1,2,3... 68 max! everything works, u can see effects.


!TFS 0.3.6!!


Wtf? I dont know why, how this works like that. Can someone help me to add effects with high number than 68?
 
Last edited:
Okay i was start server with old .exe and it works, but i dont have source for this, so I was download some source 0.3.6 and compile it... Now i know the problem is in source... Guys do u know where can i find good source for 0.3.6 without bugs like this ?
 
Maybe you should make codes correct?

like:
Lua:
local pos = variantToPosition(var)
doSendMagicEffect(pos, 60)
 
  • local pos = variantToPosition(var)
  • doSendMagicEffect(pos, 60)
Nope, it doesnt work.

Okay so i find some info about it in another forums, people have the same problem like me but i dont find how to repair it.

So my TFS 0.3.6 blocked MagicEffects to 69 MAX.

Strange because normal its 254 Magic Effects MAX.

So someone know where and how can i change it to max 254 Magic Effects?
 
You have to define it in sources
tools.cpp
C++:
MagicEffectNames magicEffectNames[] =
const.h
C++:
enum MagicEffect_t
 
Solution
lol if you use the command !z you have to change the range in talkaction script related to this.

If you want to use with functions you should add them to const.h in sources and/or in lib if it will be needed.
 
You have to define it in sources
tools.cpp
C++:
MagicEffectNames magicEffectNames[] =
const.h
C++:
enum MagicEffect_t

How? :D Can u help me with this? please

lol if you use the command !z you have to change the range in talkaction script related to this.

If you want to use with functions you should add them to const.h in sources and/or in lib if it will be needed.

I dont used this command
 
I define it in tools.cpp
Code:
{"bats",        MAGIC_EFFECT_BATS},
    {"smoke",        MAGIC_EFFECT_SMOKE},
    {"insects",        MAGIC_EFFECT_INSECTS},
    {"A",        MAGIC_EFFECT_A},
    {"B",        MAGIC_EFFECT_B},
    {"C",        MAGIC_EFFECT_C},

and in const.h
Code:
MAGIC_EFFECT_BATS        = 0x42, //66
    MAGIC_EFFECT_SMOKE        = 0x43, //67
    MAGIC_EFFECT_INSECTS        = 0x44, //68
    MAGIC_EFFECT_A        = 0x45, //69
    MAGIC_EFFECT_B        = 0x46, //70
    MAGIC_EFFECT_C        = 0x47, //71

And nothing... i missed something ?

EDIT:
Code const.h:

Code:
enum MagicEffect_t
{
    MAGIC_EFFECT_DRAW_BLOOD    = 0x00,
    MAGIC_EFFECT_LOSE_ENERGY    = 0x01,
    MAGIC_EFFECT_POFF        = 0x02,
    MAGIC_EFFECT_BLOCKHIT        = 0x03,
    MAGIC_EFFECT_EXPLOSION_AREA    = 0x04,
    MAGIC_EFFECT_EXPLOSION_DAMAGE    = 0x05,
    MAGIC_EFFECT_FIRE_AREA        = 0x06,
    MAGIC_EFFECT_YELLOW_RINGS    = 0x07,
    MAGIC_EFFECT_POISON_RINGS    = 0x08,
    MAGIC_EFFECT_HIT_AREA        = 0x09,
    MAGIC_EFFECT_TELEPORT        = 0x0A, //10
    MAGIC_EFFECT_ENERGY_DAMAGE    = 0x0B, //11
    MAGIC_EFFECT_WRAPS_BLUE    = 0x0C, //12
    MAGIC_EFFECT_WRAPS_RED    = 0x0D, //13
    MAGIC_EFFECT_WRAPS_GREEN    = 0x0E, //14
    MAGIC_EFFECT_HITBY_FIRE    = 0x0F, //15
    MAGIC_EFFECT_POISON        = 0x10, //16
    MAGIC_EFFECT_MORT_AREA        = 0x11, //17
    MAGIC_EFFECT_SOUND_GREEN    = 0x12, //18
    MAGIC_EFFECT_SOUND_RED        = 0x13, //19
    MAGIC_EFFECT_POISON_AREA    = 0x14, //20
    MAGIC_EFFECT_SOUND_YELLOW    = 0x15, //21
    MAGIC_EFFECT_SOUND_PURPLE    = 0x16, //22
    MAGIC_EFFECT_SOUND_BLUE    = 0x17, //23
    MAGIC_EFFECT_SOUND_WHITE    = 0x18, //24
    MAGIC_EFFECT_BUBBLES        = 0x19, //25
    MAGIC_EFFECT_CRAPS        = 0x1A, //26
    MAGIC_EFFECT_GIFT_WRAPS    = 0x1B, //27
    MAGIC_EFFECT_FIREWORK_YELLOW    = 0x1C, //28
    MAGIC_EFFECT_FIREWORK_RED    = 0x1D, //29
    MAGIC_EFFECT_FIREWORK_BLUE    = 0x1E, //30
    MAGIC_EFFECT_STUN        = 0x1F, //31
    MAGIC_EFFECT_SLEEP        = 0x20, //32
    MAGIC_EFFECT_WATERCREATURE    = 0x21, //33
    MAGIC_EFFECT_GROUNDSHAKER    = 0x22, //34
    MAGIC_EFFECT_HEARTS        = 0x23, //35
    MAGIC_EFFECT_FIREATTACK    = 0x24, //36
    MAGIC_EFFECT_ENERGY_AREA    = 0x25, //37
    MAGIC_EFFECT_SMALLCLOUDS    = 0x26, //38
    MAGIC_EFFECT_HOLYDAMAGE    = 0x27, //39
    MAGIC_EFFECT_BIGCLOUDS        = 0x28, //40
    MAGIC_EFFECT_ICEAREA        = 0x29, //41
    MAGIC_EFFECT_ICETORNADO    = 0x2A, //42
    MAGIC_EFFECT_ICEATTACK        = 0x2B, //43
    MAGIC_EFFECT_STONES        = 0x2C, //44
    MAGIC_EFFECT_SMALLPLANTS    = 0x2D, //45
    MAGIC_EFFECT_CARNIPHILA    = 0x2E, //46
    MAGIC_EFFECT_PURPLEENERGY    = 0x2F, //47
    MAGIC_EFFECT_YELLOWENERGY    = 0x30, //48
    MAGIC_EFFECT_HOLYAREA        = 0x31, //49
    MAGIC_EFFECT_BIGPLANTS        = 0x32, //50
    MAGIC_EFFECT_CAKE        = 0x33, //51
    MAGIC_EFFECT_GIANTICE        = 0x34, //52
    MAGIC_EFFECT_WATERSPLASH    = 0x35, //53
    MAGIC_EFFECT_PLANTATTACK    = 0x36, //54
    MAGIC_EFFECT_TUTORIALARROW    = 0x37, //55
    MAGIC_EFFECT_TUTORIALSQUARE    = 0x38, //56
    MAGIC_EFFECT_MIRRORHORIZONTAL    = 0x39, //57
    MAGIC_EFFECT_MIRRORVERTICAL    = 0x3A, //58
    MAGIC_EFFECT_SKULLHORIZONTAL    = 0x3B, //59
    MAGIC_EFFECT_SKULLVERTICAL    = 0x3C, //60
    MAGIC_EFFECT_ASSASSIN        = 0x3D, //61
    MAGIC_EFFECT_STEPSHORIZONTAL    = 0x3E, //62
    MAGIC_EFFECT_BLOODYSTEPS    = 0x3F, //63
    MAGIC_EFFECT_STEPSVERTICAL    = 0x40, //64
    MAGIC_EFFECT_YALAHARIGHOST    = 0x41, //65
    MAGIC_EFFECT_BATS        = 0x42, //66
    MAGIC_EFFECT_SMOKE        = 0x43, //67
    MAGIC_EFFECT_INSECTS        = 0x44, //68
    MAGIC_EFFECT_A        = 0x45, //69
    MAGIC_EFFECT_B        = 0x46, //70
    MAGIC_EFFECT_C        = 0x47, //71
    MAGIC_EFFECT_D        = 0x48, //72
    MAGIC_EFFECT_E        = 0x49, //73
    MAGIC_EFFECT_F        = 0x4A, //74
    MAGIC_EFFECT_G        = 0x4B, //75
    MAGIC_EFFECT_H        = 0x4C, //76
    MAGIC_EFFECT_I        = 0x4D, //77
    MAGIC_EFFECT_J        = 0x4E, //78
    MAGIC_EFFECT_K        = 0x4F, //79
    MAGIC_EFFECT_L        = 0x50, //80
    MAGIC_EFFECT_M        = 0x51, //81
    MAGIC_EFFECT_N        = 0x52, //82
    MAGIC_EFFECT_O        = 0x53, //83
    MAGIC_EFFECT_P        = 0x54, //84
    MAGIC_EFFECT_R        = 0x55, //85
    MAGIC_EFFECT_S        = 0x56, //86
    MAGIC_EFFECT_T        = 0x57, //87
    MAGIC_EFFECT_AA        = 0x58, //88
    MAGIC_EFFECT_AB        = 0x59, //89
    MAGIC_EFFECT_AC        = 0x5A, //90
    MAGIC_EFFECT_AD        = 0x5B, //91
    MAGIC_EFFECT_AE        = 0x5C, //92
    MAGIC_EFFECT_AF        = 0x5D, //93
    MAGIC_EFFECT_AG        = 0x5E, //94
    MAGIC_EFFECT_AH        = 0x5F, //95
    MAGIC_EFFECT_AI        = 0x60, //96
    MAGIC_EFFECT_AJ        = 0x61, //97
    MAGIC_EFFECT_AK        = 0x62, //98
    MAGIC_EFFECT_AL        = 0x63, //99
    MAGIC_EFFECT_AM        = 0x64, //100
    MAGIC_EFFECT_AN        = 0x65, //101
    MAGIC_EFFECT_AO        = 0x66, //102
    MAGIC_EFFECT_AP        = 0x67, //103
    MAGIC_EFFECT_AR        = 0x68, //104
    MAGIC_EFFECT_AS        = 0x69, //105
    MAGIC_EFFECT_AT        = 0x6A, //106
    MAGIC_EFFECT_BA        = 0x6B, //107
    MAGIC_EFFECT_BB        = 0x6C, //108
    MAGIC_EFFECT_BC        = 0x6D, //109
    MAGIC_EFFECT_BD        = 0x6E, //110
    MAGIC_EFFECT_BE        = 0x6F, //111
    MAGIC_EFFECT_BF        = 0x70, //112
    MAGIC_EFFECT_BG        = 0x71, //113
    MAGIC_EFFECT_BH        = 0x72, //114
    MAGIC_EFFECT_BI        = 0x73, //115
    MAGIC_EFFECT_BJ        = 0x74, //116
    MAGIC_EFFECT_BK        = 0x75, //117
    MAGIC_EFFECT_BL        = 0x76, //118
    MAGIC_EFFECT_BM        = 0x77, //119
    MAGIC_EFFECT_BN        = 0x78, //120
    MAGIC_EFFECT_BO        = 0x79, //121
    MAGIC_EFFECT_BP        = 0x7A, //122
    MAGIC_EFFECT_BR        = 0x7B, //122
    MAGIC_EFFECT_BS        = 0x7C, //123
    MAGIC_EFFECT_BT        = 0x7D, //124
    MAGIC_EFFECT_CA     = 0x7E, //125
    MAGIC_EFFECT_CB     = 0x7F, //126
    MAGIC_EFFECT_CC     = 0x80, //127
    MAGIC_EFFECT_CD     = 0x81, //128
    MAGIC_EFFECT_CE     = 0x82, //129
    MAGIC_EFFECT_CF     = 0x83, //130
    MAGIC_EFFECT_CG     = 0x84, //131
    MAGIC_EFFECT_CH     = 0x85, //132
    MAGIC_EFFECT_LAST        = MAGIC_EFFECT_CH,

    //for internal use, dont send to client
    MAGIC_EFFECT_NONE        = 0xFF,
    MAGIC_EFFECT_UNKNOWN        = 0xFFFF
};
 
Last edited:
Code:
    MAGIC_EFFECT_DE     = 0x95, //148
    MAGIC_EFFECT_DF     = 0x96, //149
    MAGIC_EFFECT_DG     = 0x97, //150
    MAGIC_EFFECT_DH     = 0x98, //151
    MAGIC_EFFECT_DI     = 0x99, //152
    MAGIC_EFFECT_DJ     = 0x9A, //153
    MAGIC_EFFECT_DK     = 0x9B, //154
    MAGIC_EFFECT_DL     = 0x9C, //155
    MAGIC_EFFECT_DM     = 0x9D, //156
    MAGIC_EFFECT_DN     = 0x9E, //157
    MAGIC_EFFECT_DO     = 0x9F, //158                            
    MAGIC_EFFECT_LAST        = MAGIC_EFFECT_DO,
    //for internal use, dont send to client
    MAGIC_EFFECT_NONE        = 0xFF,
    MAGIC_EFFECT_UNKNOWN        = 0xFFFF
};


I add 158 effects in const.h so i want add more, can someone said what number can i give to MAGIC_EFFECT_DP = ????, //159 ?
 
Back
Top