zoukankan      html  css  js  c++  java
  • T端PVP头衔获得NPC脚本

     次代码是一个T端的脚本。通过击杀的角色数量等级来获得不同的头衔。
    
    下面的Ranks就是击杀的数量。根据你的击杀数量,你可以到NPC那里去领取对应的头衔等级
    
    #include "ScriptPCH.h" 
     
    enum Ranks
    {
        RANK_1    = 50,
        RANK_2    = 100,
        RANK_3    = 500,
        RANK_4    = 1000,
        RANK_5    = 2000,
        RANK_6    = 4000,
        RANK_7    = 5000,
        RANK_8    = 6000,
        RANK_9    = 8000,
        RANK_10 = 10000,
        RANK_11 = 12500,
        RANK_12 = 15000,
        RANK_13 = 20000,
        RANK_14 = 25000,
    };
     
    class PVPTitles : public PlayerScript
    {
    public:
        PVPTitles() : PlayerScript("PVPTitles") { }
     
        void OnPVPKill(Player *Killer, Player *Killed) 
        {
    
    // 如果是自杀
    if (Killer->GetGUID() == Killed->GetGUID()) return; uint32 team = killer->GetTeam();  //战场荣誉击杀数量
    switch(Killer->GetUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS)) { case RANK_1: Killer->SetTitle(sCharTitlesStore.LookupEntry(1 + (team == ALLIANCE ? 0 : 14)); break; case RANK_2: Killer->SetTitle(sCharTitlesStore.LookupEntry(2 + (team == ALLIANCE ? 0 : 14)); break; case RANK_3: Killer->SetTitle(sCharTitlesStore.LookupEntry(3 + (team == ALLIANCE ? 0 : 14)); break; case RANK_4: Killer->SetTitle(sCharTitlesStore.LookupEntry(4 + (team == ALLIANCE ? 0 : 14)); break; case RANK_5: Killer->SetTitle(sCharTitlesStore.LookupEntry(5 + (team == ALLIANCE ? 0 : 14)); break; case RANK_6: Killer->SetTitle(sCharTitlesStore.LookupEntry(6 + (team == ALLIANCE ? 0 : 14)); break; case RANK_7: Killer->SetTitle(sCharTitlesStore.LookupEntry(7 + (team == ALLIANCE ? 0 : 14)); break; case RANK_8: Killer->SetTitle(sCharTitlesStore.LookupEntry(8 + (team == ALLIANCE ? 0 : 14)); break; case RANK_9: Killer->SetTitle(sCharTitlesStore.LookupEntry(9 + (team == ALLIANCE ? 0 : 14)); break; case RANK_10: Killer->SetTitle(sCharTitlesStore.LookupEntry(10 + (team == ALLIANCE ? 0 : 14)); break; case RANK_11: Killer->SetTitle(sCharTitlesStore.LookupEntry(11 + (team == ALLIANCE ? 0 : 14)); break; case RANK_12: Killer->SetTitle(sCharTitlesStore.LookupEntry(12 + (team == ALLIANCE ? 0 : 14)); break; case RANK_13: Killer->SetTitle(sCharTitlesStore.LookupEntry(13 + (team == ALLIANCE ? 0 : 14)); break; case RANK_14: Killer->SetTitle(sCharTitlesStore.LookupEntry(14 + (team == ALLIANCE ? 0 : 14)); break; } } }; void AddSC_PVPTitles() { new PVPTitles(); }
  • 相关阅读:
    HDU 3853 LOOPS:期望dp【网格型】
    SGU 495 Kids and Prizes:期望dp / 概率dp / 推公式
    BZOJ 1629 [Usaco2005 Nov]Cow Acrobats:贪心【局部证明】
    BZOJ 3400 [Usaco2009 Mar]Cow Frisbee Team 奶牛沙盘队:dp【和为f的倍数】
    BZOJ 1685 [Usaco2005 Oct]Allowance 津贴:贪心【给硬币问题】
    codeforces-473D Mahmoud and Ehab and another array construction task (素数筛法+贪心)
    poj1964最大子矩阵 (单调栈加枚举)
    poj3111 选取物品(二分+贪心)
    codeforces-777E Hanoi Factory (栈+贪心)
    poj3040 发工资(贪心)
  • 原文地址:https://www.cnblogs.com/needly/p/3752746.html
Copyright © 2011-2022 走看看