From 5bab3b0d09e1e92f40b247a3b34e5e78ecc9468d Mon Sep 17 00:00:00 2001 From: Muhaha Date: Tue, 13 Oct 2009 20:21:50 +0200 Subject: [PATCH] *matrix punch script. --HG-- branch : trunk --- sql/updates/5868_world.sql | 4 ++ .../scripts/scripts/world/go_scripts.cpp | 64 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 sql/updates/5868_world.sql diff --git a/sql/updates/5868_world.sql b/sql/updates/5868_world.sql new file mode 100644 index 0000000000..117cc8cee6 --- /dev/null +++ b/sql/updates/5868_world.sql @@ -0,0 +1,4 @@ +UPDATE `gameobject_template` SET `ScriptName` = 'go_matrix_punchograph' WHERE `gameobject_template`.`entry` =142345 LIMIT 1 ; +UPDATE `gameobject_template` SET `ScriptName` = 'go_matrix_punchograph' WHERE `gameobject_template`.`entry` =142475 LIMIT 1 ; +UPDATE `gameobject_template` SET `ScriptName` = 'go_matrix_punchograph' WHERE `gameobject_template`.`entry` =142476 LIMIT 1 ; +UPDATE `gameobject_template` SET `ScriptName` = 'go_matrix_punchograph' WHERE `gameobject_template`.`entry` =142696 LIMIT 1 ; \ No newline at end of file diff --git a/src/bindings/scripts/scripts/world/go_scripts.cpp b/src/bindings/scripts/scripts/world/go_scripts.cpp index f09817a45f..068388d4bf 100644 --- a/src/bindings/scripts/scripts/world/go_scripts.cpp +++ b/src/bindings/scripts/scripts/world/go_scripts.cpp @@ -479,6 +479,65 @@ bool GOHello_go_wg2voa_portal(Player* pPlayer, GameObject* pGO) return false; } +/*###### +## matrix_punchograph +######*/ + +enum +{ + ITEM_WHITE_PUNCH_CARD = 9279, + ITEM_YELLOW_PUNCH_CARD = 9280, + ITEM_BLUE_PUNCH_CARD = 9282, + ITEM_RED_PUNCH_CARD = 9281, + ITEM_PRISMATIC_PUNCH_CARD = 9316, + SPELL_YELLOW_PUNCH_CARD = 11512, + SPELL_BLUE_PUNCH_CARD = 11525, + SPELL_RED_PUNCH_CARD = 11528, + SPELL_PRISMATIC_PUNCH_CARD = 11545, + MATRIX_PUNCHOGRAPH_3005_A = 142345, + MATRIX_PUNCHOGRAPH_3005_B = 142475, + MATRIX_PUNCHOGRAPH_3005_C = 142476, + MATRIX_PUNCHOGRAPH_3005_D = 142696, +}; + +bool GOHello_go_matrix_punchograph(Player* pPlayer, GameObject* pGo) +{ + switch(pGo->GetEntry()) + { + case MATRIX_PUNCHOGRAPH_3005_A: + if(pPlayer->HasItemCount(ITEM_WHITE_PUNCH_CARD, 1)) + { + pPlayer->DestroyItemCount(ITEM_WHITE_PUNCH_CARD, 1, true); + pPlayer->CastSpell(pPlayer,SPELL_YELLOW_PUNCH_CARD,true); + } + break; + case MATRIX_PUNCHOGRAPH_3005_B: + if(pPlayer->HasItemCount(ITEM_YELLOW_PUNCH_CARD, 1)) + { + pPlayer->DestroyItemCount(ITEM_YELLOW_PUNCH_CARD, 1, true); + pPlayer->CastSpell(pPlayer,SPELL_BLUE_PUNCH_CARD,true); + } + break; + case MATRIX_PUNCHOGRAPH_3005_C: + if(pPlayer->HasItemCount(ITEM_BLUE_PUNCH_CARD, 1)) + { + pPlayer->DestroyItemCount(ITEM_BLUE_PUNCH_CARD, 1, true); + pPlayer->CastSpell(pPlayer,SPELL_RED_PUNCH_CARD,true); + } + break; + case MATRIX_PUNCHOGRAPH_3005_D: + if(pPlayer->HasItemCount(ITEM_RED_PUNCH_CARD, 1)) + { + pPlayer->DestroyItemCount(ITEM_RED_PUNCH_CARD, 1, true); + pPlayer->CastSpell(pPlayer,SPELL_PRISMATIC_PUNCH_CARD,true); + } + break; + default: + break; + } + return false; +} + void AddSC_go_scripts() { Script *newscript; @@ -593,5 +652,10 @@ void AddSC_go_scripts() newscript->Name = "go_wg2voa_portal"; newscript->pGOHello = &GOHello_go_wg2voa_portal; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_matrix_punchograph"; + newscript->pGOHello = &GOHello_go_matrix_punchograph; + newscript->RegisterSelf(); }