Commit
…owing spells to be casted directly Closes #2108
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
DELETE FROM `spell_script_names` WHERE `spell_id` IN(4073,19804,12749,13258,13166); | ||
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES | ||
(4073,'spell_gen_allow_cast_from_item_only'), | ||
(19804,'spell_gen_allow_cast_from_item_only'), | ||
(12749,'spell_gen_allow_cast_from_item_only'), | ||
(13258,'spell_gen_allow_cast_from_item_only'), | ||
(13166,'spell_gen_allow_cast_from_item_only'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1125,6 +1125,35 @@ class spell_gen_magic_rooster : public SpellScriptLoader | |
} | ||
}; | ||
|
||
class spell_gen_allow_cast_from_item_only : public SpellScriptLoader | ||
{ | ||
public: | ||
spell_gen_allow_cast_from_item_only() : SpellScriptLoader("spell_gen_allow_cast_from_item_only") { } | ||
|
||
class spell_gen_allow_cast_from_item_only_SpellScript : public SpellScript | ||
{ | ||
PrepareSpellScript(spell_gen_allow_cast_from_item_only_SpellScript); | ||
|
||
SpellCastResult CheckRequirement() | ||
{ | ||
if (!GetCastItem()) | ||
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW; | ||
|
||
return SPELL_CAST_OK; | ||
} | ||
|
||
void Register() | ||
{ | ||
OnCheckCast += SpellCheckCastFn(spell_gen_allow_cast_from_item_only_SpellScript::CheckRequirement); | ||
} | ||
}; | ||
|
||
SpellScript* GetSpellScript() const | ||
{ | ||
return new spell_gen_allow_cast_from_item_only_SpellScript(); | ||
} | ||
}; | ||
|
||
void AddSC_generic_spell_scripts() | ||
{ | ||
new spell_gen_absorb0_hitlimit1(); | ||
|
@@ -1151,4 +1180,5 @@ void AddSC_generic_spell_scripts() | |
new spell_gen_turkey_marker(); | ||
new spell_gen_lifeblood(); | ||
new spell_gen_magic_rooster(); | ||
new spell_gen_allow_cast_by_item_only(); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Vincent-Michael
Contributor
|
||
} |
3 comments
on commit 3de4279
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When compiling on Linux it gives an error. I did a make -j 8 and got this at the end:
[ 36%] Building CXX object src/server/game/CMakeFiles/game.dir/Weather/WeatherMgr.cpp.o
[ 36%] Building CXX object src/server/game/CMakeFiles/game.dir/World/World.cpp.o
Linking CXX static library libgame.a
[ 36%] Built target game
make: *** [all] Error 2
[ 2%] Built target jemalloc
[ 7%] Built target g3dlib
[ 8%] Built target gsoap
[ 8%] Built target revision.h
[ 9%] Built target shared_pch_dephelp
[ 9%] Built target pch_Generate_shared
[ 11%] Built target shared
[ 11%] Built target game_pch_dephelp
[ 12%] Built target pch_Generate_game
[ 32%] Built target game
[ 32%] Built target collision_pch_dephelp
[ 32%] Built target pch_Generate_collision
[ 33%] Built target collision
[ 33%] Built target authserver_pch_dephelp
[ 33%] Built target pch_Generate_authserver
[ 33%] Built target authserver
[ 34%] Built target scripts_pch_dephelp
[ 34%] Built target pch_Generate_scripts
[ 34%] Building CXX object src/server/scripts/CMakeFiles/scripts.dir/Spells/spell_generic.cpp.o
/home/trinity/src/server/scripts/Spells/spell_generic.cpp: In function ‘void AddSC_generic_spell_scripts()’:
/home/trinity/src/server/scripts/Spells/spell_generic.cpp:1183:9: error: expected type-specifier before ‘spell_gen_allow_cast_by_item_only’
/home/trinity/src/server/scripts/Spells/spell_generic.cpp:1183:9: error: expected ‘;’ before ‘spell_gen_allow_cast_by_item_only’
make[2]: *** [src/server/scripts/CMakeFiles/scripts.dir/Spells/spell_generic.cpp.o] Error 1
make[1]: *** [src/server/scripts/CMakeFiles/scripts.dir/all] Error 2
make: *** [all] Error 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blah, I did some undo and went too far
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't worry Shocker, you still SHOCK us with your updates ;)
compile error in this line:
"error C2061: syntax error : identifier 'spell_gen_allow_cast_by_item_only'